// Simulate(Uno) link sketch to Arduino board here
int count;
#define OUTPIN1 6
#define OUTPIN2 7
#define TESTPIN 8
int PIR_State = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(OUTPIN1, OUTPUT);
pinMode(OUTPIN2, OUTPUT);
pinMode(TESTPIN, INPUT);
}
void loop() {
// write code here so that the state of the OUTPIN mirrors that of the TESTPIN
PIR_State = digitalRead(TESTPIN);
if (PIR_State == HIGH){
Serial.println("Motion Detected!");
digitalWrite(OUTPIN1, LOW);
digitalWrite(OUTPIN2, HIGH);
delay(500);
} else if (PIR_State == LOW){
Serial.println("No Motion Detected!");
digitalWrite(OUTPIN1, HIGH);
digitalWrite(OUTPIN2, LOW);
delay(500);
}
}