File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,10 @@ def getPosition(self):
138138 '''
139139 position_file = "%s/position" % self .base_dir
140140 print ("getPosition(): position_file: {0}" .format (position_file ))
141- print ("getPosition(): TODO: read position_file" )
141+ position_handle = open (position_file , 'r' )
142+ print ("getPosition(): position_handle: {0}" .format (position_handle ))
143+ position = position_handle .read ()
144+ print ("getPosition(): position: {0}" .format (position ))
142145 #return sysfs.kernelFileIO(position_file)
143146
144147 def setFrequency (self ,freq ):
Original file line number Diff line number Diff line change 11#!/usr/bin/python
22
33import Adafruit_BBIO .Encoder as Encoder
4-
5- qep = Encoder .RotaryEncoder (1 )
4+ # A on P8.11 and B on P8.12
5+ qep = Encoder .RotaryEncoder (2 )
66#qep = Encoder.QEP()
77print qep
88
You can’t perform that action at this time.
0 commit comments