#define PIR 13
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
}
void loop() {
pirsensor();
delay(1000); // this speeds up the simulation
}
void pirsensor() {
bool value = digitalRead(PIR);
if (value == 0) {
Serial.println("tidakada gerakan");
} else if (value == 1) {
// Blynk.notify("Warning! Please check your security system");
Serial.println("ada gerakan");
}
}