Hello Everyone! I am having a hard time trying to accomplish something i thought would be fairly simple and im wondering if it is even possible at this point. i want my ATMEGA 2560 to run a code that ive written that monitors the state of charge on a battery and triggers certain actions depending on the battery state, my code works fine by itself. what im looking for is i also what the option to install a switch that when flipped in starts the Blynk.run(); function and allows me to control the board manually as long as the switch is flipped on but when i flip the switch off i want blynk to stop. is there a way to do this? is there not a function i can use that would be the equivalent of Blynk.stop(); or something like that? i tried putting blynk.run inside of a while loop thinking that would be the easy solution but it seems blynk.run happens even if the conditions for the while loop are not met. honestly im lost. any help would be greatly appreciated,
p.s. ive looked into using a timer, but im not exactly sure how using a timer will help me since i need it to respond to the battery voltage and not just perform functions at given times.