Skip to content

Instantly share code, notes, and snippets.

@glafranceri
Last active November 9, 2016 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glafranceri/6dd7c68c90ef938a69c62a4bc3b75bcf to your computer and use it in GitHub Desktop.
Save glafranceri/6dd7c68c90ef938a69c62a4bc3b75bcf to your computer and use it in GitHub Desktop.
Smart Calendar Picture Frame - Python RPi.GPIO test script
#!/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