Skip to content

Instantly share code, notes, and snippets.

@glafranceri

glafranceri/gpio_test.py

Last active Nov 9, 2016
Embed
What would you like to do?
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