Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update motion_detection/motion_detection/motion_detection.ino

  • Loading branch information...
commit 66fb14c947205d31fb491a1497b911d320eebc5b 1 parent b8dc0f4
@mangar authored
Showing with 7 additions and 10 deletions.
  1. +7 −10 motion_detection/motion_detection/motion_detection.ino
View
17 motion_detection/motion_detection/motion_detection.ino
@@ -1,23 +1,20 @@
-
int led = 13;
int infraPin = 7;
-// the setup routine runs once when you press reset:
void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
pinMode(infraPin, INPUT);
}
-// the loop routine runs over and over again forever:
-void loop() {
-
- Serial.println("lendo....");
- digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
+
+void loop() {
+ Serial.println("reading....");
+ digitalWrite(led, LOW);
if (digitalRead(infraPin)) {
- Serial.println("ATIVO");
- digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
- delay(2000); // wait for a second
+ Serial.println("ACTIVE");
+ digitalWrite(led, HIGH);
+ delay(2000);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.