Skip to content

Commit be5b4a3

Browse files
committed
mimxrt: Fixes to the documentation of the Encoder/Counter class.
Thanks to @androiddrew for testing the code and finding the inconsitencies to the documentation.
1 parent 5747cc1 commit be5b4a3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

docs/library/machine.QECNT.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Example usage::
1919
qe.init(cpc=128) # Specify 128 counts/cycle
2020
qe.init(index=Pin(3)) # Specify Pin 3 as Index pulse input
2121
qe.deinit() # turn off the Quadrature Encoder
22-
qe.init(match=64) # Set a match event at count 64
2322
qe.irq(qe.IRQ_MATCH, value=100, handler=handler)
2423
# Call the function handler at a match event
2524

@@ -62,7 +61,7 @@ Constructors
6261
(1000000000 * 2550 * 4 / CPU_CLK). A value of 0 sets the filter off.
6362
- *cpc*\=value. Specify the number of counts per cycle. Since the
6463
Encoder counts all four phases of the input signal, the cpc value has to be four
65-
time the ppr value given in the encoder data sheet. The position counter will count up
64+
times the ppr value given in the encoder data sheet. The position counter will count up
6665
from the 0 up to cpc - 1, and then reset to the init value of 0 and increase
6766
the cycles counter by one. The default is: no cpc set. In that case the
6867
position counter overflows at 2**32 - 1. When counting down, the cycles counter changes
@@ -78,7 +77,7 @@ The arguments phase_a, phase_b and filter_ns are generic across ports, all other
7877
Methods
7978
-------
8079

81-
.. method:: Encoder.init(*, phase_a, phase_b, home, reverse, match_pin, filter_ns, cpc, match, signed, index)
80+
.. method:: Encoder.init(*, phase_a, phase_b, home, match_pin, filter_ns, cpc, signed, index)
8281

8382
Modify settings for the Encoder object. See the above constructor for details
8483
about the parameters.
@@ -183,7 +182,6 @@ Example usage::
183182
counter.value(0) # Set the counter to 0
184183
counter.init(cpc=128) # Specify 128 counts/cycle
185184
counter.deinit() # turn off the Counter
186-
counter.init(match=1000) # Create a match event at count 1000
187185
counter.irq(Counter.IRQ_MATCH, handler) # Call the function handler at a counter match
188186

189187
counter # show the Counter object properties

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy