ME 405 Portfolio
comboDriver.Controller Class Reference

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...
 

Detailed Description

Controller class.

Incorperates motor and encoder driver to create a position cotrolled motor

Constructor & Destructor Documentation

◆ __init__()

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.

Parameters
motorUnitA MotorBase object consisting of 2 DC motors
encodersA list of encoders associated with the the DC motors on the MotorBase

Member Function Documentation

◆ enableMotors()

def comboDriver.Controller.enableMotors (   self)

Enables motors.

Enable both motors of the MotorBase by setting the sleep pin low

Parameters
None

◆ goToPosition()

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.

Parameters
motorThe motor to move to a desired position
encoderThe encoder associated wtih the motor
positionThe desired position for the motor

Member Data Documentation

◆ encoder1

comboDriver.Controller.encoder1

First Motor Encoder.

Encoder from the encoders tuple upon object creation

◆ encoder2

comboDriver.Controller.encoder2

Second Motor Encoder.

Encoder from the encoders tuple upon object creation

◆ max

comboDriver.Controller.max

Max encoder value.

Maximum value we wallow the encoder to reach

◆ motor1

comboDriver.Controller.motor1

First motor.

Motor from the motor base class

◆ motor2

comboDriver.Controller.motor2

Second motor.

Motor from the motor base class

◆ motorBase

comboDriver.Controller.motorBase

Object from Motor Base class.

Contains two motors to be used


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