The missing widgets

Flashing Led twice without blocking blynk

#define LedSys 2 // onboard Pin Led
WidgetLED FlashLed(24); //Led widget

void setup(){
 timer.setInterval(1000, blinkLedWidget);// flash every secondes
//other ....
}

void blinkLedWidget() {
  timer.setTimer(200L, FlashingLed, 2);  // Pulse Led 2 times
}

void FlashingLed() { // Non-blocking timer w/ 100 milis interval
  FlashLed.on();
  digitalWrite(LedSys, LOW);
  timer.setTimeout(100L, []()  {
  FlashLed.off();
  digitalWrite(LedSys, HIGH);
  });  
}
3 Likes