From 3230f3ae186f0f35d602f9b36c29719fda372635 Mon Sep 17 00:00:00 2001 From: Ben Nuttall Date: Sat, 17 Oct 2015 22:11:59 +0100 Subject: [PATCH] Add PWMLED, close #58 --- gpiozero/__init__.py | 1 + gpiozero/output_devices.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/gpiozero/__init__.py b/gpiozero/__init__.py index a32803b..47636f0 100644 --- a/gpiozero/__init__.py +++ b/gpiozero/__init__.py @@ -18,6 +18,7 @@ from .input_devices import ( from .output_devices import ( OutputDevice, PWMOutputDevice, + PWMLED, LED, Buzzer, Motor, diff --git a/gpiozero/output_devices.py b/gpiozero/output_devices.py index e8709d9..15dc17b 100644 --- a/gpiozero/output_devices.py +++ b/gpiozero/output_devices.py @@ -256,6 +256,10 @@ class PWMOutputDevice(DigitalOutputDevice): self._frequency = value +class PWMLED(PWMOutputDevice): + pass + + def _led_property(index, doc=None): return property( lambda self: getattr(self._leds[index], 'value'), @@ -263,6 +267,7 @@ def _led_property(index, doc=None): doc ) + class RGBLED(object): """ Single LED with individually controllable red, green and blue components.