示例#1
0
 def __init__(self, enable_channel=None, tasks=None):
     self.enable_channel = enable_channel
     self.enabled = self.DISABLED
     if enable_channel is not None:
         self.enable_task = DOTask()
         self.enable_task.createChannel(enable_channel)
     elif enable_channel is None:
         self.enable()
     tasks = (tasks if tasks is not None else []) + (
         [self.enable_task] if self.enable_channel is not None else [])
     BaseStepperMotor.__init__(self, tasks=tasks)
示例#2
0
 def __init__(self,
              direction_channel,
              enable_channel=None,
              backlash=0,
              direction=DirectionStepperMotor.FORWARDS,
              tasks=None):
     self.direction_task = DOTask()
     self.direction_task.createChannel(direction_channel)
     DirectionStepperMotor.__init__(
         self,
         enable_channel=enable_channel,
         backlash=backlash,
         direction=direction,
         tasks=((tasks if tasks is not None else []) +
                [self.direction_task]))
示例#3
0
 def __init__(self,
              step_channel,
              counter_channel,
              direction_channel,
              log_file=None,
              enable_channel=None,
              step_rate=500.0,
              backlash=0,
              tasks=None):
     self.step_task = DOTask()
     self.step_task.createChannel(step_channel)
     self.setStepRate(step_rate)
     self.step_task.writeState(False)
     tasks = (tasks if tasks is not None else []) + [self.step_task]
     LoggedStepperMotor.__init__(self, counter_channel, direction_channel,
                                 log_file, enable_channel, backlash, tasks)