Interface with two DR8847 motors. More...
Public Member Functions | |
def | __init__ (self, dutyX, dutyY, state) |
Constructs a motor driver object and creates two motor objects. More... | |
def | run (self) |
Updates each motor to run at the specified duty cycle. More... | |
def | enable (self) |
This method enables the motors. More... | |
def | disable (self) |
This method disables the motors. More... | |
Interface with two DR8847 motors.
This class has one main function that runs the two motors.
def task_motor.Task_Motor.__init__ | ( | self, | |
dutyX, | |||
dutyY, | |||
state | |||
) |
Constructs a motor driver object and creates two motor objects.
The contructor function creates a motor driver object and creates two motor objects from the motor driver.
dutyX | A shares. Share object describing the duty cycle to run the motor responsible for controlling the x direction. |
dutyY | A shares. Share object describing the duty cycle to run the motor responsible for controlling the y direction. |
def task_motor.Task_Motor.disable | ( | self | ) |
This method disables the motors.
This changes a value that is multiplied to the duty cycle. This multiplier is "0" in this method.
def task_motor.Task_Motor.enable | ( | self | ) |
This method enables the motors.
This changes a value that is multiplied to the duty cycle. This multiplier is "1" in this method.
def task_motor.Task_Motor.run | ( | self | ) |
Updates each motor to run at the specified duty cycle.
This function reads from the duty cycle shares object. The data from the duty cycle is then used to run a method of the motor driver class to set the duty cycle.