Fun with PWM  0.32
Motion.Servo Class Reference

Servo abstraction. More...

Inheritance diagram for Motion.Servo:
JsonBlob.JsonBlob

Public Member Functions

def __init__ (self, index=None)
 
def resetData (self)
 
def buildPulseTable (self)
 
def setCallback (self, func)
 
def setServoAngle (self, time=None, modifier=0)
 
def doCallback (self)
 
def relax (self)
 
def reload (self)
 
def save (self)
 
- Public Member Functions inherited from JsonBlob.JsonBlob
def __init__ (self, index=None, autoload=True)
 
def reload (self)
 
def save (self)
 
def delete (self)
 
def blobExists (self)
 
def getModulePath (self)
 
def getTypePath (self)
 
def getRowPath (self)
 
def getRowFileName (self)
 

Public Attributes

 jsonData
 
 now
 
 modifier
 
 channel
 
 angle
 
 trim
 
 disabled
 
 inverted
 
 pulsetable
 
 time
 
- Public Attributes inherited from JsonBlob.JsonBlob
 jbModule
 
 jbType
 
 jbIndex
 
 jsonData
 

Additional Inherited Members

- Static Public Member Functions inherited from JsonBlob.JsonBlob
def reindex (force=False)
 
def find (jbModule, jbType, jbIndex)
 
def all (jbModule=None, jbType=None)
 
def hydrate (jbModule=None, jbType=None, ids=[])
 
- Static Public Attributes inherited from JsonBlob.JsonBlob
 basepath = os.path.join(AmsEnvironment.FilePath(), 'jsonblob')
 
 indexpath = os.path.join(basepath, 'index.json')
 
dictionary constructors = {}
 
bool indexexists = False
 
bool indexed = False
 
dictionary index = {}
 

Detailed Description

Servo abstraction.

Constructor & Destructor Documentation

§ __init__()

def Motion.Servo.__init__ (   self,
  index = None 
)
Initializes the Servo object

@param index

Member Function Documentation

§ buildPulseTable()

def Motion.Servo.buildPulseTable (   self)
pre-calculate pwm values and index by angle 

§ doCallback()

def Motion.Servo.doCallback (   self)
perform callback

§ relax()

def Motion.Servo.relax (   self)
relax servo

§ reload()

def Motion.Servo.reload (   self)
sync object with saved data

§ resetData()

def Motion.Servo.resetData (   self)
sync servo with saved data

§ save()

def Motion.Servo.save (   self)
override JsonBlob.save() to allow specification ID to be inserted

§ setCallback()

def Motion.Servo.setCallback (   self,
  func 
)
sets the function to use for callbacks

@param func

§ setServoAngle()

def Motion.Servo.setServoAngle (   self,
  time = None,
  modifier = 0 
)
sync the physical servo angle with in-memoty value

@param time int
@param modifier int

The documentation for this class was generated from the following file: