Add a pwm option to the RGBLED and Motor constructors

...along with the other necessary changes required, to allow them to
optionally be used with non-PWM-capable pins
This commit is contained in:
Andrew Scheller
2016-04-29 12:06:29 +01:00
parent 1b7dad5fa4
commit c9461c50d3
7 changed files with 378 additions and 141 deletions

View File

@@ -28,7 +28,7 @@ PWMLED
RGBLED
======
.. autoclass:: RGBLED(red, green, blue, active_high=True, initial_value=(0, 0, 0))
.. autoclass:: RGBLED(red, green, blue, active_high=True, initial_value=(0, 0, 0), pwm=True)
:members: on, off, toggle, blink, pulse, red, green, blue, is_lit, color
Buzzer
@@ -40,7 +40,7 @@ Buzzer
Motor
=====
.. autoclass:: Motor(forward, backward)
.. autoclass:: Motor(forward, backward, pwm=True)
:members: forward, backward, stop
Base Classes