#define sensorPin D10 void setup() { //put your setup cpde jere. tp run once: Serial.begin(9600); pinMode(sensorPin, INPUT); } void loop() { //put your main code here, to run repeatedly: while (digitalRead(sensorPin)==LOW); Serial.println("Motion detected!"); while (digitalRead(sensorPin)!=LOW); Serial.println("No motion"); }