So Im very new to all of this but i managed to get this sketch working from copying from different places, its a simple blynk voltage monitor with OTA and a server running so I dont have to manually reset each WEMOS to do the OTA updates…
All works great, besides the Delay at the very bottom in the void loop, which delays everything, i have 3 relays hooked up to this wemos also and would prefer for them not to have a delay
What Im trying for is to get a timer for the V1 VirtuaWrite so it only updates every 30 min. to an hour since its just monitoring a battery bank…
and if possible maybe every 30 seconds when im looking at it in the Blynk App, but thats not mandatory
Seems like it would be a simple fix if I knew what I was doing lol
Any advice on how to make this happen would be greatly appreciated
setup is a wemos D1 mini and a voltage divider
Dont know how to share the sketch on here so link below is to a .txt of the sketch.
And go through the sketch, and see if it works. And also study the code and understand what are the modifications made and how it works, so that you can use the same technic in the future.
YOUR the man… THANK YOU SO MUCH
that is exactly what i was looking for…
Iam looking for a way to donate $$ to you for helping me…
new to this site…is there a way? or a way to like? or ?
VERY VERY much appreciate it… code worked perfect…thanks
whats the difference in the
timer.setInterval(3000L, voltageRead);
and the
timer.setTimeout(30000L, { ??
Thank you. But here we like to learn and also share what we know. We dont expect anything but good gratitude in the forum .
Here the function void voltageRead() is called every 30sec by the BlynkTimer.
By following this we dont disturb the Blynk.run(); in the loop and cause any sought of disconnections.
This is just like delay(3000);. But delay will cause the whole program to halt till the delay time is over. By doing this the blynk server will get no response from the device and this results in disconnection from server. So its a good practice to always use Lambda timers.
@Madhukesh so as not to confuse @scottjvincent I think you have the 3 seconds and 30 seconds switched around. 3000L is 3s and 30000L is 30s. Just divide by 1000.