Hi, I can’t change the state of digital pin D5 via virtual pin V5, I would like pressing the V5 on blynk to change it
state of button D5 to which a button is connected, what am I wrong?
Thank you.
What you’re doing here is reading the value of pin D5 (GPIO14) and assigning the resulting value to the Pulsant100 variable.
Because D5 is a digital pin, the result stored in Pulsant100 will be a 0 or a 1.
You are then saying digitalWrite(Pulsante100, LOW) or digitalWrite(Pulsante100, HIGH)
As Pulsant100 is a 0 or a 1, you are actually trying to make the GPIO0 (D3) or GPIO1(The Tx pin) HIGH or LOW.
As you don’t have PinMode statements for GPIO0 or 1 then these command probably have no effect.
You would at least be writing to the correct digital pin, but as you are reading the value of D5 I assume that you actually want to use the V5 virtual pin to toggle the state of the D5 pin. If that’s the case then you should use the logical NOT operator (the exclamation mark) to write the logical opposite of the current D5 state, like this…