minilib Library

Documentation for the Library

minilib.ArcadeDrive

class minilib.Drive.ArcadeDrive(self, left, right)
__init__(self, left, right)

Setup Arcade drive

Parameters:
  • left – left side drive
  • rightServo (continuous_servo) – right side drive
drive(self, forwardPower, steerPower)

Drive given the forward and steer axis power Meant to be run inside a while loop

Parameters:
  • forwardPower (float) – Forward power from joystick axis
  • steerPower (float) – Steer power from joystick axis

minilib.TankDrive

class minilib.Drive.TankDrive(self, left, right)
__init__(self, left, right)

Setup Arcade drive

Parameters:
  • left – left side drive
  • rightServo (continuous_servo) – right side drive
drive(self, leftPower, rightPower)
Drive given the left and right axis power
Meant to be run inside a while loop
Parameters:
  • leftPower (float) – Forward power from joystick axis
  • rightPower (float) – Steer power from joystick axis

minilib.Joystick

class minilib.Joystick.Joystick(self, ID, deadband=0)
__init__(self, ID, deadband=0)

Setup Joystick control using pygame :param id: ID of the joystick :type id: int

getAxis(self, axisID)

Get the value of the axis

Parameters:axisID (int) – Id of the axis
Returns:value of the axis
Return type:float
getButton(self, buttonID)

Get the state of the button

Parameters:buttonID (int) – Id of the button
Returns:state of the button
Return type:bool

minilib.Motor

class minilib.Motor.Motor(self, ID)
__init__(self, ID)

Inintialize the DC Motor

Parameters:ID (int) – The ID of the Motor [0,1]
throttle(self, power)

Input power for the Motor

Parameters:power (float) – Value from -1 to 1

minilib.Servo

class minilib.Servo.Servo(self, ID)
__init__(self, ID)

Initialize a Servo

Parameters:ID (int) – ID of the Servo [0,1,2,3]
angle(self, degree)

Set the angle to rotate to

Parameters:degree (int) – degree of the Servo

minilib.Servo.ContiniousServo

class minilib.Servo.ContiniousServo(self, ID)
__init__(self, ID)

Initialize a Continious Servo

Parameters:ID (int) – ID of the Continious Servo [0,1,2,3]
throttle(self, power)

Set the throttle of the Continious Servo

Parameters:power (float) – Power of the Continious Servo -1 to 1