You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: analogue.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ Now you've tested you can read values from the potentiometer, you should connect
91
91
from gpiozero import PWMLED
92
92
```
93
93
94
-
The `PWMLED` class lets you control the brightness of an LED using PWM (Pulse-width modulation)
94
+
The `PWMLED` class lets you control the brightness of an LED using PWM, or pulse-width modulation.
95
95
96
96
1. Create a `PWMLED` object on pin 21:
97
97
@@ -119,8 +119,8 @@ Now you've tested you can read values from the potentiometer, you should connect
119
119
120
120
GPIO Zero has a powerful feature: **source and values**. Every device has a `value` property (the current value) and a `values` property (a stream of the device's values at all times). Every output device has a `source` property which can be used to set what the device's value should be.
121
121
122
-
- `pot.value` gives the potentiometer's current value (it's read only - as it's an input device)
123
-
- `led.value` is the LED's current value (it's read/write - you can see what it is, and you can change it)
122
+
- `pot.value` gives the potentiometer's current value (it's read only, as it's an input device)
123
+
- `led.value` is the LED's current value (it's read/write: you can see what it is, and you can change it)
124
124
- `pot.values` is a generator constantly yielding the potentiometer's current value
125
125
- `led.source` is a way of setting where the LED gets its values from
126
126
@@ -143,13 +143,13 @@ while True:
143
143
pot2 = MCP3008(1)
144
144
```
145
145
146
-
1. Blink the LED:
146
+
1. Make the LED blink:
147
147
148
148
```python
149
149
led.blink()
150
150
```
151
151
152
-
The LED will blink continuously, 1 second on, 1 second off.
152
+
The LED will blink continuously, one second on and one second off.
153
153
154
154
1. Change the `on_time` and `off_time` parameters to make it blink faster or slower:
155
155
@@ -184,6 +184,6 @@ while True:
184
184
185
185
- Use potentiometers to control other GPIO Zero output devices
186
186
- Use potentiometers to control the speed of motors
187
-
- Use potentiometers to control the visual settings of a camera module in real time
187
+
- Use potentiometers to control the visual settings of a Camera Module in real time
188
188
- Find more analogue sensors that will work with the ADC
189
189
- Use potentiometers to control a player in a [PyGame Zero](http://pygame-zero.readthedocs.io) game, or in [Minecraft](https://www.raspberrypi.org/learning/getting-started-with-minecraft-pi/)
0 commit comments