#define BLYNK_PRINT Serial
#define BLYNK_TEMPLATE_ID "TMPL2yvoXn4mF"
#define BLYNK_TEMPLATE_NAME "LUZ"
#define BLYNK_AUTH_TOKEN "phSGRBE9rU_PpKQwyJHFtEb3nIO3Rew5"
#include <BlynkSimpleEsp32.h>
#include <WiFi.h>
#include <WiFiClient.h>
char* red="Wokwi-GUEST";
char* password="";
byte ldr=34;
int lectura=0;
byte porcentaje=0;
void setup() {
pinMode(ldr,INPUT);
Serial.begin(115200);
Blynk.begin(BLYNK_AUTH_TOKEN,red,password);
}
void loop() {
Blynk.run();
lectura=analogRead(ldr);//12 4096 0-4095
porcentaje=map(lectura,0,4095,100,0);
Blynk.virtualWrite(V0,porcentaje);
delay(1000);
}