|
Files | |
file | mindsensors-rcxmotormux.h |
RobotC Mindsensors RCX Motor MUX Driver. | |
Defines | |
#define | MSMTRMX_I2C_ADDR 0xB4 |
#define | MSMTRMX_MOTOR_REG 0x42 |
Enumerations | |
enum | tMSMTRMXSettings { MSMTRMX_MODE_FLOAT = 0, MSMTRMX_MODE_FORWARD = 1, MSMTRMX_MODE_REVERSE = 2, MSMTRMX_MODE_BRAKE = 3 } |
enum | tMSMTRMXMotors { MSMTRMX_M1 = 0, MSMTRMX_M2 = 1, MSMTRMX_M3 = 2, MSMTRMX_M4 = 3 } |
Functions | |
bool | MSMTRMX_Control (tSensors link, tMSMTRMXMotors channel, int power, ubyte address=MSMTRMX_I2C_ADDR) |
bool | MSMTRMX_Brake (tSensors link, tMSMTRMXMotors channel, unsigned byte brakeForce, ubyte address=MSMTRMX_I2C_ADDR) |
Variables | |
tByteArray | MSMTRMX_I2CMessage |
RCX Motor MUX
#define MSMTRMX_I2C_ADDR 0xB4 |
i2c address/registers MSMTRMX I2C device address
Definition at line 33 of file mindsensors-rcxmotormux.h.
#define MSMTRMX_MOTOR_REG 0x42 |
Motor address
Definition at line 34 of file mindsensors-rcxmotormux.h.
enum tMSMTRMXMotors |
motors struct, these are the four motor channels on the MUX
Definition at line 45 of file mindsensors-rcxmotormux.h.
enum tMSMTRMXSettings |
motor settings struct, each motor can be set to one of these modes
Definition at line 37 of file mindsensors-rcxmotormux.h.
bool MSMTRMX_Brake | ( | tSensors | link, |
tMSMTRMXMotors | channel, | ||
unsigned byte | brakeForce, | ||
ubyte | address | ||
) |
This function applies the specified braking power to the specified motor
link | port number |
channel | motor number |
brakeForce | brake power to set the motor to (0-255, 0 == float) |
address | the I2C address to use, optional, defaults to 0xB4 |
Definition at line 108 of file mindsensors-rcxmotormux.h.
bool MSMTRMX_Control | ( | tSensors | link, |
tMSMTRMXMotors | channel, | ||
int | power, | ||
ubyte | address = MSMTRMX_I2C_ADDR |
||
) |
Function prototypes
This function sets the specified motor to the given power level, with the motor floated at speed zero. The controller floats during inactive PWM periods.
link | port number |
channel | motor number |
power | speed to set the motor to (-255 to +255) |
address | the I2C address to use, optional, defaults to 0xB4 |
Definition at line 69 of file mindsensors-rcxmotormux.h.
Array to hold I2C command data
Definition at line 52 of file mindsensors-rcxmotormux.h.