BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Eventor after timer

Hello,
Happy to join this forum, I’am a Blynk beginer, in my first project I have three leds Green/Orange/Red binded on V0/V1/V2 and i want that if Red led/V2 is on for 5 min i receice à mail from Blynk server, how i can do that without modify the software on my ESP8266 side ??

Thanks for reading
Plaurenc

You need a timer to check if LED is ON or OFF after 5 mn
something like that


BLYNK_WRITE(V2) // LED ON/OFF
{
selectmode = param.asInt(); 
if(selectmode ==1){
timer1 = timer.setInterval(300000L, Check);   // Setup a function to be called every 5 mn
// led on
 }
 else
{
timer.deleteTimer(timer1); //delete timer1
// led off
  }
}

void Check(){
//check the led and send mail if timer is on after 5 mn
}