mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-10-29 17:50:37 +00:00
Update docs: add PWMLED and include value, values and source properties
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user