#define LED 0
#define LDR 4
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(LED, OUTPUT);
pinMode(LDR, INPUT);
}
int adc;
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
adc = analogRead(LDR);
Serial.println(adc);
if(adc > 2800){
digitalWrite(LED, HIGH);
}else{
digitalWrite(LED, LOW);
}
delay(250);
}