mirror of
https://github.com/KevinMidboe/python-gpiozero.git
synced 2025-12-08 20:39:01 +00:00
Fix #182
Fixes LEDBarGraph (broken by snowpi updates) and adds PWM support and relevant recipes
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 108 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 297 KiB After Width: | Height: | Size: 348 KiB |
@@ -638,6 +638,17 @@ connected to a :class:`MCP3008` analog to digital converter::
|
||||
with MCP3008(channel=0) as pot:
|
||||
print(pot.value)
|
||||
|
||||
Present the value of a potentiometer on an LED bar graph using PWM to represent
|
||||
states that won't "fill" an LED::
|
||||
|
||||
from gpiozero import LEDBarGraph, MCP3008
|
||||
from signal import pause
|
||||
|
||||
graph = LEDBarGraph(5, 6, 13, 19, 26, pwm=True)
|
||||
pot = MCP3008(channel=0)
|
||||
graph.source = pot.values
|
||||
pause()
|
||||
|
||||
|
||||
Measure temperature with an ADC
|
||||
===============================
|
||||
|
||||
Reference in New Issue
Block a user