#define IR_SENSOR 4
void setup() {
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(IR_SENSOR, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int a=digitalRead(IR_SENSOR);
Serial.print("Detected: ");
if(a==1){
Serial.println("HIGH");
} else{
Serial.println("LOW");
}
delay(5000); // this speeds up the simulation
}