im searching for a timer to simulate day and night in cycle of 30min
example:
timer 30 to 0 (start night) turns pin8 HIGH (all streetlights will turn on and traffic lights flash yellow)
timer 0 to 30 (start day) turns pin 8 LOW (all streetlights will turn off and traffic lights works normal)
in a loop 0-30 -> 30-0 -> 0-30 ect ect
There are many resources here to help you learn how Blynk works, so that you can learn to control anything you want.
At the Upper Right of this page there are links to the Documents, Help Center and Sketch Builder, where you can learn the commands and see many example sketches that will help you get started.
I would suggest learning how BlynkTimer works and simply setting up a range of coded timers to cycle through your needed pin operations.
You can also search this forum for keywords that might bring up other topics full of questions, ideas and even some code, suitable for using timers and RTC.
Here is a simple timer example I provided for another user… Take something like this and build it up into whatever timed sequences you need.
Basic timer snippet for an Action - Delay - Action function.
BLYNK_WRITE(Vx) { // Virtual button on Vx to activate action
int BTN = param.asInt();
if (BTN == 1) {
digitalWrite(pin, HIGH); // Set pin high
timer.setTimeout(5000L, ActionOFF); // Run ActionOFF function in 5 seconds
}
}
void ActionOFF() {
digitalWrite(pin, LOW); // Set pin Low
}
I got some modular buildings and I still want to make some lights in them, especially the cinema.
One thing to remember when you use the timer is that when you define a period, you add the L behind the time, that will define it as long because otherwise your timer will do weird stuff