![]() |
MatrixMiniR4 1.1.5
Matrix Mini R4 Arduino Library API Documentation
|
Class for controlling motors and servos in the Matrix Controller (HT). More...
#include <MiniR4MxCtrlExt.h>
Public Member Functions | |
void | begin () |
Initializes the MatrixController. | |
void | motorSet (uint8_t motor_ch, uint8_t speed) |
Sets the speed of the specified motor. | |
void | motorRound (uint8_t motor_ch, float round) |
Moves the specified motor a certain number of rounds. | |
void | motorInvert (uint8_t motor_ch, bool invert) |
Inverts the direction of the specified motor. | |
void | servoSet (uint8_t servo_ch, uint8_t angle) |
Sets the angle of the specified servo. | |
float | getBattery () |
Gets the current battery status. | |
Public Attributes | |
uint8_t | _ch =0 |
TwoWire * | _pWire |
Class for controlling motors and servos in the Matrix Controller (HT).
Matrix Controller is a blue box can control 9v motor, manufacturer by HiTechnic.
This class provides methods for setting motor speed, target position, servo angles, and reading battery status.
Definition at line 47 of file MiniR4MxCtrlExt.h.
void MatrixController::begin | ( | ) |
Initializes the MatrixController.
Definition at line 9 of file MiniR4MxCtrlExt.cpp.
float MatrixController::getBattery | ( | ) |
Gets the current battery status.
Definition at line 116 of file MiniR4MxCtrlExt.cpp.
void MatrixController::motorInvert | ( | uint8_t | motor_ch, |
bool | invert ) |
Inverts the direction of the specified motor.
motor_ch | The channel of the motor to invert. |
invert | True to invert, false to keep normal direction. |
Definition at line 60 of file MiniR4MxCtrlExt.cpp.
void MatrixController::motorRound | ( | uint8_t | motor_ch, |
float | round ) |
Moves the specified motor a certain number of rounds.
motor_ch | The channel of the motor to move. |
round | The number of rounds to move the motor. |
Definition at line 37 of file MiniR4MxCtrlExt.cpp.
void MatrixController::motorSet | ( | uint8_t | motor_ch, |
uint8_t | speed ) |
Sets the speed of the specified motor.
motor_ch | The channel of the motor to set. |
speed | The speed to set for the motor. |
Definition at line 27 of file MiniR4MxCtrlExt.cpp.
void MatrixController::servoSet | ( | uint8_t | servo_ch, |
uint8_t | angle ) |
Sets the angle of the specified servo.
servo_ch | The channel of the servo to set. |
angle | The angle to set for the servo. |
Definition at line 101 of file MiniR4MxCtrlExt.cpp.
uint8_t MatrixController::_ch =0 |
Definition at line 59 of file MiniR4MxCtrlExt.h.
TwoWire* MatrixController::_pWire |
Definition at line 60 of file MiniR4MxCtrlExt.h.