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