Skip to content

Instantly share code, notes, and snippets.

@gtrstitch
Created June 10, 2013 17:35
Show Gist options
  • Save gtrstitch/5750691 to your computer and use it in GitHub Desktop.
Save gtrstitch/5750691 to your computer and use it in GitHub Desktop.
import time
import RPi.GPIO as io
io.setmode(io.BCM)
pir_pin = 18
led_pin = 23
io.setup(pir_pin, io.IN)
io.setup(led_pin, io.OUT)
while True:
if io.input(pir_pin):
io.output(led_pin, True)
else:
io.output(led_pin, False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment