Created
November 23, 2012 10:21
-
-
Save parsons-Jsr/4134921 to your computer and use it in GitHub Desktop.
Raspberry Pi: Python script that activate LED on sensor detection (by JSRP)
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
import RPi.GPIO as GPIO | |
from time inport sleep | |
GPIO.setmode (GPIO.BOARD) | |
GPIO.Setup (7, GPIO.IN) | |
GPIO.Setup (11, GPIO.OUT) | |
while 1: | |
if GPIO.input(7): | |
GPIO.output(11, False) | |
else: | |
GPIO.output(11, True) | |
Sleep(0.01) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment