void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(4, INPUT_PULLUP);
}
void loop() {
int a=digitalRead(4);
Serial.println(a);
if (a==HIGH)
{
Serial.println("motion detected");
}
if(a==LOW)
{
Serial.println("motion not detected");
}
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}