init pwm as digital

This commit is contained in:
Siwat Sirichai 2024-02-17 01:16:20 +07:00
parent 68dac6a4d0
commit 18b3fa2e40

View file

@ -103,6 +103,11 @@ void setup()
espmega.enableWebServer(80); espmega.enableWebServer(80);
espmega.inputs.registerCallback(on_pin_change); espmega.inputs.registerCallback(on_pin_change);
espmega.outputs.setAutoSaveToFRAM(true); espmega.outputs.setAutoSaveToFRAM(true);
// Set value of pin 0-12 to 4095
for (uint8_t i = 0; i < 13; i++)
{
espmega.outputs.setValue(i, 4095);
}
espmega.installCard(2, &climateCard); espmega.installCard(2, &climateCard);
climateCard.bindFRAM(&espmega.fram, 5000); climateCard.bindFRAM(&espmega.fram, 5000);
climateCard.loadStateFromFRAM(); climateCard.loadStateFromFRAM();