//Interfacing Sensor to control LED when LDR value is 200 with ESP32.
//Interfacing ESP32 with LDR to monitor the light intensity.
void setup() {
// put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(35, INPUT);
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println(analogRead(35));
if(analogRead(35)<200){
digitalWrite(2, HIGH);
}else{
digitalWrite(2, LOW);
}
}