dolls
February 28, 2018, 3:39pm
1
Hii all , i’m new in blynk and have a problem with my project.
when me press “OFF ALL” button, button in LAMP 1 - LAMP 3 keep turn on,
how me to solve this problem ?
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#define Relay1 D2
#define Relay2 D3
#define Relay3 D4
char auth = “xxx”;
char ssid = “tux”;
char pass = “qwertyui”;
BLYNK_WRITE(V1){
// OFF ALL
digitalWrite(Relay1, HIGH);
digitalWrite(Relay2, HIGH);
digitalWrite(Relay3, HIGH);
}
BLYNK_WRITE(V2){
// ON ALL
digitalWrite(Relay1, LOW);
digitalWrite(Relay2, LOW);
digitalWrite(Relay3, LOW);
}
void setup() {
Blynk.begin(auth, ssid, pass);
}
void loop()
{
Blynk.run();
}
Costas
February 28, 2018, 3:59pm
2
D4 which is really GPIO 2 is special, switch to D1 which is GPIO 5.
dolls
February 28, 2018, 5:23pm
3
this problem only in app blynk , when press Virtual button , button in PWM / digital can’t turn off
The relays turn OFF, but the APP Buttons stay ON?
dolls
February 28, 2018, 5:42pm
5
yes ,
i want use Blynk.setProperty but in docs only for Virtual button ,
im use Digital button / PWM for relay
Blynk.setProperty is for changing labels and colors. It doesn’t do anything to the button state. I suggest you read through the DOCs and check out some examples (see sync physical button example). You need a better understanding of how BLYNK and its commands work. Even if I told you what command to use (it is Blynk.virtualWrite(Vpin, value); by the way), you probably wouldn’t know how to make it work without doing some research first.
1 Like
dolls
February 28, 2018, 6:25pm
7
how to set properties on Digitial button ?
in this case , i want to disable Digital button with Virtual button
Gunner
February 28, 2018, 6:01pm
8
dolls:
how to set properties on Digitial button ?
in this case , i want to disable Digital button with Virtual button
Please don’t tack “how toos” onto old and unrelated topics.
Or create two separate topics for similar issues
I moved your posts into a this topic
how to set properties on Digitial button ?
You can’t… only on virtual pins.
As per the Documents… http://docs.blynk.cc/#blynk-main-operations-change-widget-properties
NOTE : Changing these parameters work only for widgets attached to Virtual pins (analog/digital pins won’t work).
i want to disable Digital button with Virtual button
Use a Blynk Function like BLYNK_WRITE(vPIN) to create a logic flag, then you would then use with if() logic when responding to your physical button…
E.g. When physical button pushed AND flag = 1 do whatever the button is supposed to do. but if flag = 0 then do not do anything.