int IRSensor=2;
int LED=12;
void setup() {
Serial.begin(9600);
pinMode(IRSensor, INPUT);
pinMode(LED, OUTPUT);
}
void loop() {
int statusSensor = digitalRead(IRSensor);
if(statusSensor == 1)
{
digitalWrite(LED, LOW);
Serial.print("motion detected");
delay(1000);
}
else
{
digitalWrite(LED, HIGH);
Serial.print("motion not detected");
delay(1000);
}
// put your main code here, to run repeatedly:
}