int led=16;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(led,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
int k=analogRead(34);
Serial.print("ldr:");
Serial.println(k);
if(k>=500){
digitalWrite(led,HIGH);
}else{
digitalWrite(led,LOW);
}
}