int motion=7;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(motion, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int m=digitalRead(motion);
if (m==HIGH)
{
Serial.print("motion detected!");
}
else
{
Serial.print("motion not detected!");
}
Serial.println(" ");
delay(1000);
}