Hello. I’ve made a code to open/close the garage door that works great, but I’d also like to add a magnetic sensor. I’m currently trying to make the code work only for the magnetic sensor,but I can’t make it work. The code is supposed to show 1 or 0 in a value display widget inside Blynk, depending on the state. Here’s the code:
For the BlynkTimer to run, you need timer.run(); in your void loop.
This:
will call your stagiu function one thousand timer per second. If you want to call it once per second then the interval needs to be 1000L (once every 1000 milliseconds).
This line should be deleted from your void loop:
Pin D0 (GPIO16) isn’t the best pin to use.
Read this: