Yes, but not the way you’ve written the sketch.
As I said initially…
So when your V10 widget changes it will override the sendTemps()
logic, but then the next tome that sendTemps()
is called it will override the BLYNK_WRITE(V10)
logic, switching back to automatic mode.
Your BLYNK_WRITE(V10)
code should look something like this…
bool auto_mode;
BLYNK_WRITE(V10)
{
auto_mode = param.asInt();
}
Then you expand your sendTemps()
function to take different actions if sendTemps()==true
Also, i think you’ve chosen the wrong type of board for this project. The NodeMCU really only has 5 useable pins…
hi blynkers!
the esp8266 mcu is widely used in iot projects. however, most gpio pins on this mcu have special / multiple functionality and are not safe to use in all circumstances.
these “features” are still not well documented and not explained in a friendly manner for newbies. i see lots of cases when the “issues” are simply caused by not knowing which pins to use in which case.
[esp8266 pin features]
here is a basic table for startup. i’ve collected the info from various sources on the i…
As you need at least 11 pins you would be better using an ESP32.
Also, I don’t see the point in defining aliases for your pins…
then not using them…
vanchi:
pinMode(16, OUTPUT); // sets the digital pin 16 as output
pinMode(5, OUTPUT); // sets the digital pin 5 as output
pinMode(14, OUTPUT); // sets the digital pin 14 as output
pinMode(12, OUTPUT); // sets the digital pin 12 as output
pinMode(2, OUTPUT); // sets the digital pin 2 as input
pinMode(0, OUTPUT); // sets the digital pin 16 as output
pinMode(1, OUTPUT); // sets the digital pin 5 as output
pinMode(3, OUTPUT); // sets the digital pin 14 as output
pinMode(13, OUTPUT); // sets the digital pin 12 as output
pinMode(15, OUTPUT); // sets the digital pin 2 as input
pinMode(10, OUTPUT); // blynk remote control pump
Pete.