/* motion detection sensor * */ int motionRight = 0; int motionLeft = 0; int motionPinRight = 2; int motionPinLeft = 1; int ledPin = 13; // LED connected to digital pin 13 boolean debug = true; void setup() { Serial.begin(9600); // Sets the baud rate to 9600 pinMode(ledPin, OUTPUT); // Sets the digital pin as output pinMode(motionPinRight, INPUT); pinMode(motionPinLeft, INPUT); } void loop() { readMotion(); /* // detect person if (motionVal == HIGH) { digitalWrite(ledPin, LOW); } else { digitalWrite(ledPin, HIGH); } */ //delay(100); } void readMotion(){ //read motion sensor motionRight = analogRead(motionPinRight); motionLeft = analogRead(motionPinLeft); if (debug){ Serial.print('M'); Serial.print(':'); Serial.print(motionRight); Serial.print(':'); Serial.print(motionLeft); Serial.println(); } delay(100); }