Update docs: add PWMLED and include value, values and source properties

This commit is contained in:
Ben Nuttall
2015-11-15 17:18:10 +00:00
parent 382d6e45fc
commit 4975e9c8fb
6 changed files with 168 additions and 47 deletions

View File

@@ -494,3 +494,20 @@ while True:
led.green = green_pot.value
led.blue = blue_pot.value
```
Alternatively, the following example is identical and uses the `source` property
rather than a `while` loop:
```python
from gpiozero import RGBLED, MCP3008
from signal import pause
led = RGBLED(red=2, green=3, blue=4)
red_pot = MCP3008(channel=0)
green_pot = MCP3008(channel=1)
blue_pot = MCP3008(channel=2)
led.red.source = red_pot.values
led.green.source = green_pot.values
led.blue.source = blue_pot.values
```