Esp8266- lightLED

Hey there! I want to use value from LDR attached to adc0 on esp-12 board… When value< some value trigger LED13 and simultaneously swith LED widget in app… How to i proceed with the code? Write if statement in loop and push data?


Yeap, why not =)?

thank you for the quick reply…i am very new to programming so forgive me if I ask any stupid ques…
I will explore the given examples more thoroughly and get back to you for more help., thx

1 Like

this is what i came up with:

 #include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
 char auth[] = "8d82695b6d7cxxxxxxxxx";
 int rcvpin=A0;
 void setup()
  Blynk.begin(auth, "TP-LINK", "yyy");
void loop() {  
   int ldrval=analogRead(rcvpin);

Blynk.virtualWrite(5, HIGH);
else {
  Blynk.virtualWrite(5, LOW);