I‘m having some problems with a button in the Blynk App. I‘m using an Arduino Mega2560 + W5100 + the Blynk App on iOS + the latest Version of the Blynk library.
My project consists off 5DHT22, 5 Soil Moisture Sensors and some fans. I had no problem reading the Data from the sensors and displaying them in the app. My latest addition is a button, which i wanted to use to turn the fans on and off.
So i used Blynk_Write(V40) in my code for that and it only works once but then my Arduino disconnects from the App everytime.
Does anyone know what might cause this behaviour?
I‘ve searched the forum for an hour or so now and couldn‘t really find something related, but my best guess would be that i‘m sending too much data at once maybe? I have 2000ms timers(using the BlynkTimer and setInterval()) each for sending the temperature, humidity and soil moisture and in my App i have a refresh interval of 5 seconds for each value, 15 values so far in total.
If it helps, i can upload my code in a few hours or so when i‘m back home!
Code formatting is backticks, not commas or apostrophes… I fixed it this time
As for your issue… Perhaps someone else will dig through your code for you, but I don’t wish to right now So I suggest you start by placing some Serial.print() commands in various functions to track where your code is as it runs… then perhaps you can determine exactly where it stops working.
Also, all your timer controlled functions are running at the exact same time every 2 seconds… it is recommended to space them out so they do NOT run concurrently.
Thank you! I posted my answer and then saw my mistake but couldn’t edit it, because my account was temporarily put on hold
My Timers are not set up properly yet, because i wanted too see how much traffic the arduino can handle at once and i didn’t understand how to properly stagger them yet. The example you provided perfectly explains it, thank you for that!
That totally makes sense! I randomly picked a pwm port just for testing purposes and must have overseen this! Thank you guys for the quick replies!