#define LIGHT_SENSOR_PIN 4
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
//Serial.println("Hello, ESP32!");
}
void loop() {
// put your main code here, to run repeatedly:
//delay(10); // this speeds up the simulation
int analogValue = analogRead(LIGHT_SENSOR_PIN);
Serial.println(analogValue);
delay(500);
if (analogValue < 40){
Serial.println("=>DARK");
} else if (analogValue < 800){
Serial.println("=>Dim");
} else if (analogValue < 2000){
Serial.println("=>Light");
} else if (analogValue < 3200){
Serial.println("=>Bright");
} else {
Serial.println("=>Very bright");
}
}