Skip to content

Instantly share code, notes, and snippets.

@dps
Created February 5, 2013 07:46
Show Gist options
  • Save dps/4712899 to your computer and use it in GitHub Desktop.
Save dps/4712899 to your computer and use it in GitHub Desktop.
import RPi.GPIO as gpio
import sys
import time
from webalert import WebAlert
class RelayListener(object):
def __init__(self):
gpio.setmode(gpio.BCM)
gpio.setup(18, gpio.OUT)
gpio.output(18, True)
def hit(self):
gpio.output(18, False)
time.sleep(0.25)
gpio.output(18, True)
if __name__ == '__main__':
listener = RelayListener()
w = WebAlert(sys.argv[1], listener)
w.loop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment