Add RGBLED using new PWMOutputDevice

This commit is contained in:
Ben Nuttall
2015-09-28 19:34:55 +01:00
parent cbc2b95494
commit 8fc8e3444e
5 changed files with 187 additions and 4 deletions

View File

@@ -30,8 +30,9 @@ class InputDevice(GPIODevice):
def __init__(self, pin=None, pull_up=False):
if pin in (2, 3) and not pull_up:
raise InputDeviceError(
'GPIO pins 2 and 3 are fitted with physical pull up '
'resistors; you cannot initialize them with pull_up=False')
'GPIO pins 2 and 3 are fitted with physical pull up '
'resistors; you cannot initialize them with pull_up=False'
)
super(InputDevice, self).__init__(pin)
self._pull_up = pull_up
self._active_edge = GPIO.FALLING if pull_up else GPIO.RISING