Fun with PWM  0.32
Motors.StepperMotor Class Reference

Stepper Motor abstraction. More...

Inheritance diagram for Motors.StepperMotor:
Motors.DcMotor JsonBlob.JsonBlob

Public Member Functions

def __init__ (self, index=None)
 
def resetData (self)
 
def reload (self)
 
def getOutputOrder (self, asList=False)
 
def setZeroAngle (self)
 
def moveToAngle (self, newAngle=0)
 
def moveByAngle (self, newAngle=0)
 
def updateDriveState (self)
 
def stop (self)
 
def save (self)
 
def joystickCallback (self, dev_num, signal, number, name, value, init)
 
def keyboardCallback (self, hex, ascii)
 
- Public Member Functions inherited from Motors.DcMotor
def __init__ (self, index=None)
 
def resetData (self)
 
def reload (self)
 
def addCallback (self, name, func)
 
def removeCallback (self, name)
 
def hasCallback (self, name)
 
def doCallbacks (self)
 
def start (self)
 
def stop (self)
 
def save (self)
 
def setDriveState (self, driveState=0)
 
def updateDriveState (self)
 
def simulateKeyUp (self)
 
def updateShadowState (self)
 
def initControllers (self)
 
def hasControllers (self)
 
def newController (self, controllerType='joystick')
 
def updateController (self, controller, controllerType='joystick')
 
def hasController (self, controllerType, ident)
 
def removeController (self, controllerType, ident)
 
def joystickCallback (self, dev_num, signal, number, name, value, init)
 
def keyboardCallback (self, hex, ascii)
 
- 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

 stage
 
 angle
 
 target
 
 outputOrders
 
 sequences
 
 enabled
 
 normalizeAngle
 
 minTime
 
 outputOrder
 
 sequence
 
 sequenceLength
 
 pins
 
 acceleration
 
 controllers
 
 shadowState
 
- Public Attributes inherited from Motors.DcMotor
 jsonData
 
 now
 
 shadowState
 
 driveTypes
 
 pwm
 
 scheduler
 
 kbthread
 
 last
 
 running
 
 controllersEnabled
 
 driveType
 
 pins
 
 enabled
 
 acceleration
 
 controllers
 
 driveState
 
 joystickRegistry
 
- Public Attributes inherited from JsonBlob.JsonBlob
 jbModule
 
 jbType
 
 jbIndex
 
 jsonData
 

Additional Inherited Members

- Static Public Member Functions inherited from Motors.DcMotor
def CleanupGpio ()
 
- 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

Stepper Motor abstraction.

Constructor & Destructor Documentation

§ __init__()

def Motors.StepperMotor.__init__ (   self,
  index = None 
)
Initializes the StepperMotor object

@param index

Member Function Documentation

§ getOutputOrder()

def Motors.StepperMotor.getOutputOrder (   self,
  asList = False 
)
gets the current output order

§ joystickCallback()

def Motors.StepperMotor.joystickCallback (   self,
  dev_num,
  signal,
  number,
  name,
  value,
  init 
)
move the motor to the specified angle

§ keyboardCallback()

def Motors.StepperMotor.keyboardCallback (   self,
  hex,
  ascii 
)
perform keyboard callback

§ moveByAngle()

def Motors.StepperMotor.moveByAngle (   self,
  newAngle = 0 
)
move the motor by the specified angle

§ moveToAngle()

def Motors.StepperMotor.moveToAngle (   self,
  newAngle = 0 
)
move the motor to the specified angle

§ reload()

def Motors.StepperMotor.reload (   self)
override - sync object with saved data

§ save()

def Motors.StepperMotor.save (   self)
override - saves stepper specific attributes

§ setZeroAngle()

def Motors.StepperMotor.setZeroAngle (   self)
assigns 0 angle to the current motor position

§ stop()

def Motors.StepperMotor.stop (   self)
override - also calls save for the current angle

§ updateDriveState()

def Motors.StepperMotor.updateDriveState (   self)
update drive state
called from scheduled task (runs on it's own thread)
stops stepper motor if no changes have been sent in the last 10 seconds
delays steps based on rpm and steps per rev
if a target is provided, move toward it
otherwise use drive state to determine speed

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