Blink functionality

This commit is contained in:
starcalc 2022-08-30 17:42:46 +02:00
parent b2173aba39
commit 6b16da4ab3
1 changed files with 9 additions and 0 deletions

View File

@ -23,7 +23,16 @@ void setup() {
ArduinoOTA.begin();
}
long lastmillis = 0;
bool stateled = false;
void loop() {
Homie.loop();
ArduinoOTA.handle();
if ((lastmillis+500)<millis()){
Homie.getLogger() << "Switching" << endl;
stateled = !stateled;
digitalWrite(PIN_LED, stateled?HIGH:LOW);
lastmillis = millis();
}
}