Controller class. More...
Public Member Functions | |
| def | __init__ (self, motorUnit, encoders) |
| Controller initializer. More... | |
| def | goToPosition (self, motor, encoder, position) |
| Gets the table to Position. More... | |
| def | enableMotors (self) |
| Enables motors. More... | |
Public Attributes | |
| motorBase | |
| Object from Motor Base class. More... | |
| motor1 | |
| First motor. More... | |
| motor2 | |
| Second motor. More... | |
| encoder1 | |
| First Motor Encoder. More... | |
| encoder2 | |
| Second Motor Encoder. More... | |
| max | |
| Max encoder value. More... | |
Controller class.
Incorperates motor and encoder driver to create a position cotrolled motor
| def comboDriver.Controller.__init__ | ( | self, | |
| motorUnit, | |||
| encoders | |||
| ) |
Controller initializer.
Initializes the class and saves the necessary parameters as self.variables so that they may be used in different methods of the class.
| motorUnit | A MotorBase object consisting of 2 DC motors |
| encoders | A list of encoders associated with the the DC motors on the MotorBase |
| def comboDriver.Controller.enableMotors | ( | self | ) |
Enables motors.
Enable both motors of the MotorBase by setting the sleep pin low
| None |
| def comboDriver.Controller.goToPosition | ( | self, | |
| motor, | |||
| encoder, | |||
| position | |||
| ) |
Gets the table to Position.
Sets appropriate motor duty to achieve desired postion and makes sure we get there.
| motor | The motor to move to a desired position |
| encoder | The encoder associated wtih the motor |
| position | The desired position for the motor |
| comboDriver.Controller.encoder1 |
First Motor Encoder.
Encoder from the encoders tuple upon object creation
| comboDriver.Controller.encoder2 |
Second Motor Encoder.
Encoder from the encoders tuple upon object creation
| comboDriver.Controller.max |
Max encoder value.
Maximum value we wallow the encoder to reach
| comboDriver.Controller.motor1 |
First motor.
Motor from the motor base class
| comboDriver.Controller.motor2 |
Second motor.
Motor from the motor base class
| comboDriver.Controller.motorBase |
Object from Motor Base class.
Contains two motors to be used