Haha
I have to write your code and test it
can you try to change V2 push mode to switch mode in the phone App ?
Haha
I have to write your code and test it
can you try to change V2 push mode to switch mode in the phone App ?
i did try both, currently its in switch mode. No luck!
Ok I’m writing your code to see where is the bug
That works for me :
void checkPhysicalButton()
{
if (digitalRead(P1) == LOW) {
// btnState is used to avoid sequential toggles
if (btnState != LOW) {
// Toggle LED state
ledState = !ledState;
digitalWrite(ledPin, ledState);
// Update Button Widget
if(ledState==0){
Blynk.virtualWrite(V2 , LOW);
}else{
Blynk.virtualWrite(V2 , HIGH);
}
}
btnState = LOW;
} else {
btnState = HIGH;
// Update Button Widget
}
}
okay flashing it, and i want to show you this.
in phone app it works on GPIO ( digital ) GP0,
Not virtual.
getting this error now…
error: ‘P1’ was not declared in this scope; did you mean ‘y1’?
98 | if (digitalRead(P1) == LOW) {
| ^~
| y1
exit status 1
‘P1’ was not declared in this scope; did you mean ‘y1’?
Yes replace P1 by btnPin
But V2 can’t work because you have select digitalPin instead of virtualPin
Thats why im telling you…it is working on digitalpin…nothing works if i select V2
Maybe you should look at your previous post…
Pete.
yeah i have seen it but it was posted before fixing the button sync issue.
You can’t control V2 if it isn’t a virtual button
Still no luck its not working…
we need to look somewhere else… look at the url it is working with D0 “”“oT5y/update/D0?value=0"”" not with V2.
God!!!
Maybe the Sketch Builder “Sync Physical button” example is where you should start,
Pete.
@ [Blynk_Coeur]
Man it started to pick on V2 but the problem is " button states changes for a mili sec and goes back to off
The problem is here …
I think you have to start from scratch
EEEEEEHAAA!!! WE SOLVED IT MAN
i removed the line
Blynk.virtualWrite(V2, millis() / 1000); // Send UpTime seconds to App
Its working now…tell me how do i buy you a coffee ?
why shhhhh ?
let others taste the fruit of our tree.
Ok I just saw that
Blynk.virtualWrite(V2, millis() / 1000); // Send UpTime seconds to App
Comon DM me, i really need to say thanks to you.
Because you made my smart farmhouse project completed because i need lots of these.