#define THRESHOLD 2045
const int LDR_PIN = 2;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
// Serial.println("Hello, ESP32!");
pinMode(LDR_PIN,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int ldr = analogRead(LDR_PIN);
Serial.print("LDR VAULE = ");
Serial.println(ldr);
if (ldr < THRESHOLD) {
Serial.println("LIGHT");
} else {
Serial.println("Dark");
}
delay(1000); // this speeds up the simulation
}