Hello,
I’m working on my exam project using an arduino + wifi-shield with Blynk, and have a few problems with the coding.
So i have a circuit that can regulate a 12V LED with a transistor, sending a PWM wave into the gate/base pin by using a slider in blynk, and it works as intended. But at the same time, im trying to implement a button in blynk, that sends a HIGH/LOW signal right into an analog pin. When the analog pin then reads a high signal input, it will instead run a code that automaticly regulates the LED with data it gets from some sensors. The code itself works, also when changing from getting to control the PWM signal from blynk to the automatic code, but then getting back from that, so it turns that off and you again can control from blynk, I don’t exactly know hot to.
Thanks beforehand!
EDIT:
The problem is not how to make it run the different codes when its HIGH/LOW, but rather what to put in the “do something” part in the if () statement, for the one when it’s LOW (button off) and the slider should be the one controlling the PWM signal, where it had been running a code to change the PWM signal in the previous state, where it was HIGH (button on).