Set subscribe handler data as global

Hi ScruffR! I noticed that the red SOS would appear when my device1 timer1 (pub_ambience) duration is set to 3 seconds. However at 30seconds or 60seconds, the red SOS does not appear.

Q5. I was wondering if using switch-case would work with timers than compared to if-elseif-else statement.

I tried your example code but Blynk.loop() and Blynk.timer() gives blynkparticle does not contain member loop/timer! I commented them out and pasted the code, the ldr value wasnt updated :frowning: Also, how do I set the timeout or softdelay duration?

Despite that, I was able to use BlynkTimer timer; to update ldr value in blynk app and also displaytime.

BlynkTimer timer;

void setup(){    
timer.setInterval(3000, ldrData);
}

void ldrData(){
    ldr_status=analogRead(ldr);
    Blynk.virtualWrite(V0, ldr_status);
    
    DisplayTime();
}

void loop(){
timer.run();
}

Q6. What can I use to replace the delay function which will not interrupt blynk.run in void loop since I want to display the day + date for two seconds, followed by a greeting message (e.g good morning) for two seconds and repeat this cycle.

Meanwhile, im doing some reading up on one shot timers and soft delays here...