Created
February 5, 2013 07:46
-
-
Save dps/4712899 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
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