Hi, I’ve figured out how to use virtual pins but have run into some odd behavior I cannot explain.
Hardware: Arduino Yun switching a 5v relay board on digital pin 10.
When I set up a button widget using digital pin 10, the switch actuates my relay no problem.
However, when I first set up the widget using a virtual pin and the code below, the voltage output by the physical pin 10 is very low, too low to actuate the relay coil, but enough to light an led dimly (~2v).
This is probably a hardware quirk, because when I first set the button to use digital pin 10, it works as expected. If I then switch the widget to use virtual pin 10, it starts working. Once I flash new code to the Yun, it goes back to the low voltage output on virtual pin 10.
Does anyone have insights on this quirk?
Thanks,
Mitch
BLYNK_WRITE(V10)
{
if(param.asInt()==1)
{
digitalWrite(10, HIGH);
}
else
{
digitalWrite(10, LOW);
}
}
void setup()
{
// Debug cons
Serial.begin(9600);
Blynk.begin(auth);
}
void loop()
{
Blynk.run();
}