int PIR_PIN = 5;
int led = 25;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(PIR_PIN, INPUT);
pinMode(led, OUTPUT);
Serial.println("Hello, ESP32!");
}
void loop() {
int reading = digitalRead(PIR_PIN);
Serial.println(reading);
if (reading==1)
{
digitalWrite(led, HIGH);
}
else
{
digitalWrite(led, LOW);
}
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}