Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5843b7b

Browse files
committed
ENCODERS.md: minor fixes.
1 parent 2a08f14 commit 5843b7b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

encoders/ENCODERS.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,15 @@ the rate at which callbacks occur.
164164
anthropoid ape it's debatable whether it produces anything useful :)
165165
3. `encoder_rp2.py` Version specific to Raspberry Pico RP2 chip. This uses the
166166
PIO and Viper code to achieve fast response - upto ~10K transitions/s.
167-
4. `encoder.py` An old Pyboard-specific version.
168-
5. [Asynchronous driver](https://github.com/peterhinch/micropython-async/blob/master/v3/docs/DRIVERS.md#6-quadrature-encoders)
167+
4. [Asynchronous driver](https://github.com/peterhinch/micropython-async/blob/master/v3/docs/DRIVERS.md#6-quadrature-encoders)
169168
for `uasyncio` applications.
170169

171-
These were written for encoders producing logic outputs. For switches, adapt
172-
the pull definition to provide a pull up or pull down as required, or provide
173-
physical resistors. The latter is my preferred solution as the internal
174-
resistors on most platforms have a rather high value posing a risk of slow
175-
edges.
170+
For mechanical encoders consider the need for pull up or pull down resistors.
171+
172+
Applications which just require the maintenance of a position count would
173+
normally use `encoder_portable.py`. Where callbacks are required, or tracking
174+
of detent positions is needed, the asynchronous driver is preferred for reasons
175+
covered in this document.
176176

177177
# 7. Algorithm
178178

@@ -267,7 +267,9 @@ required to track these exactly, for example triggering a callback on each
267267
[asynchronous driver](https://github.com/peterhinch/micropython-async/blob/master/v3/docs/DRIVERS.md#6-quadrature-encoders)
268268
with a division ratio of 4. Rate limiting is essential. Testing with a
269269
mechanical encoder with Schmitt trigger preconditioning (see below) produced
270-
good results with tracking maintained exactly.
270+
good results with tracking maintained exactly. Some encoders, described as
271+
"half step", have two detents per revolution. These can be handled by setting
272+
`div=2` on this driver.
271273

272274
It is almost certainly impossible to provide exact tracking on platforms which
273275
support only soft IRQ's because garbage collection results in interrupt latency

0 commit comments

Comments
 (0)