Hello all. Recently I’ve started a very small project ( I’m a beginner) using ESP8266 and Blynk app. What I wanna to do is : dim an LED, but only when the “START” button (from the Blynk app) is ON and when the button if OFF, the brightness of the LED should remain. In the app there is only one button and one slider.
Is it possible to create such a project, where you can control and LED (or any thing), but only when you “have a confirmation” ? In case you have some ideas, please share.
Thank you in advance. Wish you a beautiful day.
The arduino sketch :
define BLYNK_PRINT Serial
include <ESP8266WiFi.h>
include <BlynkSimpleEsp8266.h>
char auth[] = "xxxxxx";
const int ledPin =5;//pin on the ESP8266
int x =0;
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, "xxxxx", "xxxxx");
pinMode(ledPin,OUTPUT);
}
BLYNK_WRITE(V1) {
x = param.asInt();
Serial.print("Button is pressed : ");
Serial.println(x);
}
void loop(){
if(x == 1){
//confirmation button was pressed.....DIM the LED
}
Blynk.run();
}