int PIR = 14;
int LED = 12;
void setup()
{
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(PIR, INPUT);
pinMode(LED, OUTPUT);
}
void loop() {
int Read = digitalRead(PIR);
Serial.println(Read);
if(Read==1)
{
digitalWrite(LED, HIGH);
Serial.println("Motion yes");
}
else
{
digitalWrite(LED, LOW);
Serial.println("Motion not");
}// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}