Last active
November 9, 2016 20:40
-
-
Save glafranceri/6dd7c68c90ef938a69c62a4bc3b75bcf to your computer and use it in GitHub Desktop.
Smart Calendar Picture Frame - Python RPi.GPIO test script
This file contains 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
#!/usr/bin/env python | |
import RPi.GPIO as GPIO | |
from time import sleep | |
# Set GPIO pin numbers to Board numbers | |
GPIO.setmode(GPIO.BOARD) | |
# Define PIR to be 10 | |
PIR = 10 | |
# Setup PIR to an input | |
GPIO.setup(PIR, GPIO.IN) | |
while 1: | |
if GPIO.input(PIR): | |
print "Motion Detected" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment