Rename to gpiozero and tidy up

This commit is contained in:
Ben Nuttall
2015-09-15 17:53:08 +01:00
parent 90aed0e925
commit abdc215175
3 changed files with 139 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
from RPi import GPIO
class OutputDevice(object):
def __init__(self, pin):
self.pin = pin
GPIO.setup(pin, GPIO.OUT)
def on(self):
GPIO.output(self.pin, True)
def off(self):
GPIO.output(self.pin, False)
class LED(OutputDevice):
pass
class Buzzer(OutputDevice):
pass
class Motor(OutputDevice):
pass