Matbotics  0.2
An Arduino library to control Matrix Robotics Controller
Public Member Functions | List of all members
MTController Class Reference

#include <Matbotics.h>

Public Member Functions

 MTController ()
 
String manufacturer ()
 
String type ()
 
String version ()
 
float batteryLevel ()
 
MTBS_STATUS_VALUES status ()
 
void timeout (int time)
 
void enableServos ()
 
void disableServos ()
 
void servoOneSpeed (int servo_speed)
 
void servoOneAngle (int angle)
 
void servoTwoSpeed (int servo_speed)
 
void servoTwoAngle (int angle)
 
void servoThreeSpeed (int servo_speed)
 
void servoThreeAngle (int angle)
 
void servoFourSpeed (int servo_speed)
 
void servoFourAngle (int angle)
 
void motorOneSpeed (int motor_speed)
 
long motorOnePosition ()
 
void motorOneReach (long target)
 
void motorOneMode (MTBS_MOTOR_MODES mode)
 
void motorTwoSpeed (int motor_speed)
 
long motorTwoPosition ()
 
void motorTwoReach (long target)
 
void motorTwoMode (MTBS_MOTOR_MODES mode)
 
void motorThreeSpeed (int motor_speed)
 
long motorThreePosition ()
 
void motorThreeReach (long target)
 
void motorThreeMode (MTBS_MOTOR_MODES mode)
 
void motorFourSpeed (int motor_speed)
 
long motorFourPosition ()
 
void motorFourReach (long target)
 
void motorFourMode (MTBS_MOTOR_MODES mode)
 

Detailed Description

MTController object to encapsulate Matrix Robotic System controller control

Definition at line 140 of file Matbotics.h.

Constructor & Destructor Documentation

MTController::MTController ( )

Create MTController object

Definition at line 43 of file Matbotics.cpp.

Member Function Documentation

float MTController::batteryLevel ( )

Get battery level

Returns
The Battery level returns the current battery voltage in volts.

Definition at line 75 of file Matbotics.cpp.

void MTController::disableServos ( )

disable servos

Definition at line 100 of file Matbotics.cpp.

void MTController::enableServos ( )

enable servo motors

Definition at line 93 of file Matbotics.cpp.

String MTController::manufacturer ( )

Get the controller version manufacturer

Returns
Controller version manufacturer

Definition at line 60 of file Matbotics.cpp.

void MTController::motorFourMode ( MTBS_MOTOR_MODES  mode)

Set the motor four mode

Parameters
modethe mode for the motor four

Definition at line 231 of file Matbotics.cpp.

long MTController::motorFourPosition ( )

get the position of the motor four

Returns
Value of the current motor encoder

Definition at line 219 of file Matbotics.cpp.

void MTController::motorFourReach ( long  target)

Set the position of the motor four encoder, if the motor is in slew mode.

Parameters
targetPosition to reach

Definition at line 226 of file Matbotics.cpp.

void MTController::motorFourSpeed ( int  motor_speed)

Set the speed of the motor four, zero (0) causes the motor to stop.

Parameters
motor_speedThe speed of the motor ( from -100 to 100 )

Definition at line 214 of file Matbotics.cpp.

void MTController::motorOneMode ( MTBS_MOTOR_MODES  mode)

Set the motor one mode

Parameters
modethe mode for the motor one

Definition at line 165 of file Matbotics.cpp.

long MTController::motorOnePosition ( )

get the position of the motor one

Returns
Value of the current motor encoder value

Definition at line 153 of file Matbotics.cpp.

void MTController::motorOneReach ( long  target)

Set the position of the motor one encoder, if the motor is in slew mode.

Parameters
targetPosition to reach

Definition at line 160 of file Matbotics.cpp.

void MTController::motorOneSpeed ( int  motor_speed)

Set the speed of the motor one, zero (0) causes the motor to stop.

Parameters
motor_speedThe speed of the motor ( from -100 to 100 )

Definition at line 148 of file Matbotics.cpp.

void MTController::motorThreeMode ( MTBS_MOTOR_MODES  mode)

Set the motor three mode

Parameters
modethe mode for the motor three

Definition at line 209 of file Matbotics.cpp.

long MTController::motorThreePosition ( )

get the position of the motor three

Returns
Value of the current motor encoder value

Definition at line 197 of file Matbotics.cpp.

void MTController::motorThreeReach ( long  target)

Set the position of the motor three encoder, if the motor is in slew mode.

Parameters
targetPosition to reach

Definition at line 204 of file Matbotics.cpp.

void MTController::motorThreeSpeed ( int  motor_speed)

Set the speed of the motor three, zero (0) causes the motor to stop.

Parameters
motor_speedThe speed of the motor ( from -100 to 100 )

Definition at line 192 of file Matbotics.cpp.

void MTController::motorTwoMode ( MTBS_MOTOR_MODES  mode)

Set the motor two mode

Parameters
modethe mode for the motor two

Definition at line 187 of file Matbotics.cpp.

long MTController::motorTwoPosition ( )

get the position of the motor two

Returns
Value of the current motor encoder value

Definition at line 175 of file Matbotics.cpp.

void MTController::motorTwoReach ( long  target)

Set the position of the motor two encoder, if the motor is in slew mode.

Parameters
targetPosition to reach

Definition at line 182 of file Matbotics.cpp.

void MTController::motorTwoSpeed ( int  motor_speed)

Set the speed of the motor two, zero (0) causes the motor to stop.

Parameters
motor_speedThe speed of the motor ( from -100 to 100 )

Definition at line 170 of file Matbotics.cpp.

void MTController::servoFourAngle ( int  angle)

Set the angle of the servo four

Parameters
angleangle to reach

Definition at line 142 of file Matbotics.cpp.

void MTController::servoFourSpeed ( int  servo_speed)

Set speed of the servo four

Parameters
servo_speedthe speed to set

Definition at line 137 of file Matbotics.cpp.

void MTController::servoOneAngle ( int  angle)

Set the angle of the servo one

Parameters
angleangle to reach

Definition at line 112 of file Matbotics.cpp.

void MTController::servoOneSpeed ( int  servo_speed)

Set speed of the servo one

Parameters
servo_speedthe speed to set

Definition at line 107 of file Matbotics.cpp.

void MTController::servoThreeAngle ( int  angle)

Set the angle of the servo three

Parameters
angleangle to reach

Definition at line 132 of file Matbotics.cpp.

void MTController::servoThreeSpeed ( int  servo_speed)

Set speed of the servo three

Parameters
servo_speedthe speed to set

Definition at line 127 of file Matbotics.cpp.

void MTController::servoTwoAngle ( int  angle)

Set the angle of the servo two

Parameters
angleangle to reach

Definition at line 122 of file Matbotics.cpp.

void MTController::servoTwoSpeed ( int  servo_speed)

Set speed of the servo two

Parameters
servo_speedthe speed to set

Definition at line 117 of file Matbotics.cpp.

MTBS_STATUS_VALUES MTController::status ( )

Return the status of the box

Returns
the status of the controller

Definition at line 82 of file Matbotics.cpp.

void MTController::timeout ( int  time)

Shut down motors and servos automaticcally within if no I2C transactions are received within the specified time, in the seconds

Parameters
timeAmount of time to shut down automatically motors and servos in seconds. Zero (0) means no timeout.

Definition at line 88 of file Matbotics.cpp.

String MTController::type ( )

Get the controller version type

Returns
Controller version type

Definition at line 65 of file Matbotics.cpp.

String MTController::version ( )

Get the controller version number

Returns
Controller version number

Definition at line 70 of file Matbotics.cpp.


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