Skip to content

Commit c6b314c

Browse files
committed
return position from getPosition()
1 parent 790deb2 commit c6b314c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Adafruit_BBIO/Encoder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def getPosition(self):
143143
position = position_handle.read()
144144
print("getPosition(): position: {0}".format(position))
145145
#return sysfs.kernelFileIO(position_file)
146+
return position
146147

147148
def setFrequency(self,freq):
148149
'''

test/test_rotary.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/python
22

33
import Adafruit_BBIO.Encoder as Encoder
4-
# A on P8.11 and B on P8.12
4+
# P8.11: eqep2b_in
5+
# P8.12: eqep2a_in
6+
# run "config-pin p8.11 qep && config-pin p8.12 qep"
57
qep = Encoder.RotaryEncoder(2)
68
#qep = Encoder.QEP()
79
print qep

0 commit comments

Comments
 (0)