Add PWMLED, close #58

This commit is contained in:
Ben Nuttall
2015-10-17 22:11:59 +01:00
parent fec4bcc844
commit 3230f3ae18
2 changed files with 6 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ from .input_devices import (
from .output_devices import ( from .output_devices import (
OutputDevice, OutputDevice,
PWMOutputDevice, PWMOutputDevice,
PWMLED,
LED, LED,
Buzzer, Buzzer,
Motor, Motor,

View File

@@ -256,6 +256,10 @@ class PWMOutputDevice(DigitalOutputDevice):
self._frequency = value self._frequency = value
class PWMLED(PWMOutputDevice):
pass
def _led_property(index, doc=None): def _led_property(index, doc=None):
return property( return property(
lambda self: getattr(self._leds[index], 'value'), lambda self: getattr(self._leds[index], 'value'),
@@ -263,6 +267,7 @@ def _led_property(index, doc=None):
doc doc
) )
class RGBLED(object): class RGBLED(object):
""" """
Single LED with individually controllable red, green and blue components. Single LED with individually controllable red, green and blue components.