6#ifndef _MiniR4MxCtrlExt_H_
7#define _MiniR4MxCtrlExt_H_
13# define ADDR_PCA954X 0x70
16#define MatrixCtrl_ADDR 0x08
18#define MC_REG_STATUS 0x41
19#define MC_REG_TIMEOUT 0x42
20#define MC_REG_BATTERY 0x43
21#define MC_REG_STARTFLAG 0x44
23#define MC_REG_SERVO_ENABLE 0x45
24#define MC_REG_SERVO_SPEED 0x46
25#define MC_REG_SERVO_TARGET 0x47
27#define MC_REG_SERVO_OFFSET 2
29#define MC_REG_MOTOR_POS 0x4E
30#define MC_REG_MOTOR_TARGET 0x52
31#define MC_REG_MOTOR_SPEED 0x56
32#define MC_REG_MOTOR_MODE 0x57
34#define MC_REG_MOTOR_OFFSET 10
37#define MODE_POSITION 0
50 uint8_t _invert1, _invert2, _invert3, _invert4;
51 void motorMode(uint8_t motor, uint8_t mode);
52 uint32_t motorPosition(uint8_t);
55 void i2cWriteData(uint8_t reg, uint8_t data);
56 uint32_t i2cReadData(
int reg,
int num);
73 void motorSet(uint8_t motor_ch, uint8_t speed);
81 void motorRound(uint8_t motor_ch,
float round);
97 void servoSet(uint8_t servo_ch, uint8_t angle);
Class for controlling motors and servos in the Matrix Controller (HT).
void motorRound(uint8_t motor_ch, float round)
Moves the specified motor a certain number of rounds.
void begin()
Initializes the MatrixController.
void motorSet(uint8_t motor_ch, uint8_t speed)
Sets the speed of the specified motor.
float getBattery()
Gets the current battery status.
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.