Last active
May 3, 2017 08:40
-
-
Save maxpromer/13fc012b17f19fd6f48a097f6bcd4019 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int sensorPin = 3; | |
int indicator = 13; | |
void setup() { | |
pinMode(sensorPin, INPUT); | |
pinMode(indicator, OUTPUT); | |
Serial.begin(9600); | |
} | |
void loop() { | |
int state = digitalRead(sensorPin); | |
digitalWrite(indicator, state); | |
if(state == HIGH) { | |
Serial.println("Somebody is in this area!"); | |
} else { | |
Serial.println("No one!"); | |
} | |
delay(500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment