示例#1
0
 def disable(self):
   '''
   disable()
   Turns the eQEP hardware OFF
   '''
   enable_file = "%s/enabled" % self.base_dir
   return sysfs.kernelFilenameIO(enable_file, 0)
示例#2
0
 def getMode(self):
   '''
   getMode()
   Returns the mode the eQEP hardware is in.
   '''
   mode_file = "%s/mode" % self.base_dir
   return sysfs.kernelFilenameIO(mode_file)
示例#3
0
 def setFrequency(self,freq):
   '''
   setFrequency(freq)
   Set the frequency in Hz at which the driver reports new positions.
   '''
   period_file = "%s/period" % self.base_dir
   return sysfs.kernelFilenameIO(period_file,1000000000/freq)
示例#4
0
 def setPosition(self,val):
   ''' 
   setPosition(value)
   Give a new value to the current position
   '''
   position_file = "%s/position" % self.base_dir
   return sysfs.kernelFilenameIO(position_file,val)
示例#5
0
 def getMode(self):
     '''
 getMode()
 Returns the mode the eQEP hardware is in.
 '''
     mode_file = "%s/mode" % self.base_dir
     return sysfs.kernelFilenameIO(mode_file)
示例#6
0
 def setFrequency(self, freq):
     '''
 setFrequency(freq)
 Set the frequency in Hz at which the driver reports new positions.
 '''
     period_file = "%s/period" % self.base_dir
     return sysfs.kernelFilenameIO(period_file, 1000000000 / freq)
示例#7
0
 def disable(self):
     '''
 disable()
 Turns the eQEP hardware OFF
 '''
     enable_file = "%s/enabled" % self.base_dir
     return sysfs.kernelFilenameIO(enable_file, 0)
示例#8
0
 def setPosition(self, val):
     ''' 
 setPosition(value)
 Give a new value to the current position
 '''
     position_file = "%s/position" % self.base_dir
     return sysfs.kernelFilenameIO(position_file, val)
示例#9
0
 def setRelative(self):
   '''
   setRelative()
   Set mode as Relative
   The position is reset when the unit timer overflows.
   '''
   mode_file = "%s/mode" % self.base_dir
   return sysfs.kernelFilenameIO(mode_file, 1)
示例#10
0
 def setRelative(self):
     '''
 setRelative()
 Set mode as Relative
 The position is reset when the unit timer overflows.
 '''
     mode_file = "%s/mode" % self.base_dir
     return sysfs.kernelFilenameIO(mode_file, 1)
示例#11
0
 def setAbsolute(self):
   '''
   setAbsolute()
   Set mode as Absolute
   The position starts at zero and is incremented or 
   decremented by the encoder's movement
   '''
   mode_file = "%s/mode" % self.base_dir
   return sysfs.kernelFilenameIO(mode_file, 0)
示例#12
0
 def setAbsolute(self):
     '''
 setAbsolute()
 Set mode as Absolute
 The position starts at zero and is incremented or 
 decremented by the encoder's movement
 '''
     mode_file = "%s/mode" % self.base_dir
     return sysfs.kernelFilenameIO(mode_file, 0)
示例#13
0
 def getPosition(self):
   '''
   getPosition()
   Get the current position of the encoder.
   In absolute mode, this attribute represents the current position 
   of the encoder. 
   In relative mode, this attribute represents the position of the 
   encoder at the last unit timer overflow.
   '''
   position_file = "%s/position" % self.base_dir
   return sysfs.kernelFilenameIO(position_file)
示例#14
0
 def getPosition(self):
     '''
 getPosition()
 Get the current position of the encoder.
 In absolute mode, this attribute represents the current position 
 of the encoder. 
 In relative mode, this attribute represents the position of the 
 encoder at the last unit timer overflow.
 '''
     position_file = "%s/position" % self.base_dir
     return sysfs.kernelFilenameIO(position_file)