Hi, I need to link a digital pin with a virtual Blynk pin. Hi I need to link a digital pin with a virtual Blynk pin. I have an irrigation system, and I need to schedule the hours when it turns on. Sorry if my English is bad, I’m using a translator. I tried with this code
void setup()
{
pinMode(2, OUTPUT); // Initialise digital pin 2 as an output pin
}
BLYNK_WRITE(V0) // Executes when the value of virtual pin 0 changes
{
if(param.asInt() == 1)
{
// execute this code if the switch widget is now ON
digitalWrite(2,HIGH); // Set digital pin 2 HIGH
}
else
{
// execute this code if the switch widget is now OFF
digitalWrite(2,LOW); // Set digital pin 2 LOW
}
}
but it does not work for me.