Пример #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)