Skip to content

Commit

Permalink
[ONOFF] Set power indicator status at start (#1456)
Browse files Browse the repository at this point in the history
So that it reflects the real state of the relay even if a restart of the board was done
  • Loading branch information
1technophile authored Feb 13, 2023
1 parent df8943b commit b7e0872
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main/ZactuatorONOFF.ino
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ void setupONOFF() {
xTaskCreate(overLimitTemp, "overLimitTemp", 2500, NULL, 10, NULL);
# endif
pinMode(ACTUATOR_ONOFF_GPIO, OUTPUT);
if (digitalRead(ACTUATOR_ONOFF_GPIO) == ACTUATOR_ON) {
PowerIndicatorON();
} else {
PowerIndicatorOFF();
}
# ifdef ACTUATOR_ONOFF_DEFAULT
digitalWrite(ACTUATOR_ONOFF_GPIO, ACTUATOR_ONOFF_DEFAULT);
# endif
Expand Down

0 comments on commit b7e0872

Please sign in to comment.