Skip to content

Commit b23a861

Browse files
authored
Encoder: added usage notes
1 parent 9c08cda commit b23a861

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Adafruit_BBIO/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
22

33
This module enables access to the Beaglebone Black enhanced Quadrature Encoder Pulse (eQEP) modules: eQEP0, eQEP1 and eQEP2/eQEP2b.
44

5+
## Usage
6+
7+
On a recent Beaglebone Debian image, access to the eQEP0 and eQEP2 channels should work out of the box:
8+
9+
```python
10+
import Adafruit_BBIO.Encoder as Encoder
11+
12+
'''
13+
Each channel can be accessed and initialized using its corresponding
14+
channel name constants:
15+
16+
Encoder.eQEP0
17+
Encoder.eQEP1 # Pins only available when video is disabled
18+
Encoder.eQEP2
19+
Encoder.eQEP2b # Pins only available when video is disabled
20+
'''
21+
22+
# Instantiate the class to access channel eQEP2, and only initialize
23+
# that channel
24+
myEncoder = Encoder.RotaryEncoder(Encoder.eQEP2)
25+
```
26+
27+
If you need to use further channels, read on the prerequisites in the following section.
28+
529
## Prerequisites
630

731
These instructions are based on:

0 commit comments

Comments
 (0)