MatrixMiniR4 1.1.5
Matrix Mini R4 Arduino Library API Documentation
Loading...
Searching...
No Matches
MatrixController Class Reference

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
 

Detailed Description

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.

Member Function Documentation

◆ begin()

void MatrixController::begin ( )

Initializes the MatrixController.

Definition at line 9 of file MiniR4MxCtrlExt.cpp.

◆ getBattery()

float MatrixController::getBattery ( )

Gets the current battery status.

Returns
The battery voltage in volts.

Definition at line 116 of file MiniR4MxCtrlExt.cpp.

◆ motorInvert()

void MatrixController::motorInvert ( uint8_t motor_ch,
bool invert )

Inverts the direction of the specified motor.

Parameters
motor_chThe channel of the motor to invert.
invertTrue to invert, false to keep normal direction.

Definition at line 60 of file MiniR4MxCtrlExt.cpp.

◆ motorRound()

void MatrixController::motorRound ( uint8_t motor_ch,
float round )

Moves the specified motor a certain number of rounds.

Parameters
motor_chThe channel of the motor to move.
roundThe number of rounds to move the motor.

Definition at line 37 of file MiniR4MxCtrlExt.cpp.

◆ motorSet()

void MatrixController::motorSet ( uint8_t motor_ch,
uint8_t speed )

Sets the speed of the specified motor.

Parameters
motor_chThe channel of the motor to set.
speedThe speed to set for the motor.

Definition at line 27 of file MiniR4MxCtrlExt.cpp.

◆ servoSet()

void MatrixController::servoSet ( uint8_t servo_ch,
uint8_t angle )

Sets the angle of the specified servo.

Parameters
servo_chThe channel of the servo to set.
angleThe angle to set for the servo.

Definition at line 101 of file MiniR4MxCtrlExt.cpp.

Member Data Documentation

◆ _ch

uint8_t MatrixController::_ch =0

Definition at line 59 of file MiniR4MxCtrlExt.h.

◆ _pWire

TwoWire* MatrixController::_pWire

Definition at line 60 of file MiniR4MxCtrlExt.h.


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