HI GUYS
I’M DOING A SMAL PROJECT, MY PROJECT CONSISTS IN CONTROL LIGHTS OF MY ROOM THROUGH BLYNK AND THROUGH MANUALLY PUSH BUTTON. I’VE DONE CODE FOR ARDUINO BUT I HAVEN’T IDEA TO MAKE THIS CODE FOR BLYNK APP.
CAN SOME ONE COMPLETE THIS CODE PLEASE FOR BLYNK APP + ARDUINO + ETHERNET
I HAVE INSTALED ALL LIBRARIES
HERE IS MY CODE
int PUSHBUTTON = 2;
int PUSHBUTTON_BLYNK = 8;
int bulb = 3;
bool val = 0;
bool val2 = 0;
bool val3 = 0;
bool oldval = 0;
bool state = 0;
**void setup()**
{
pinMode(bulb,OUTPUT);
pinMode(PUSHBUTTON,INPUT);
pinMode(PUSHBUTTON_BLYNK,INPUT);
}
**void loop()**
{
val = digitalRead(PUSHBUTTON);
val2 = digitalRead(PUSHBUTTON_BLYNK);
val3= val || val2;
if ((val3 == HIGH) && (oldval == LOW))
{
state = 1 - state;
delay(10);
}
oldval = val;
if (state == 1)
{
digitalWrite(bulb, HIGH);
} else {
digitalWrite(bulb, LOW);
}
}