Mindstorms 3rd Party ROBOTC Drivers RobotC
[Home] [Download] [Submit a bug/suggestion] [ROBOTC Forums] [Blog] [Support this project]
Files | Defines | Enumerations | Functions | Variables

RCX Motor MUX
[Mindsensors]

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

Detailed Description

RCX Motor MUX


Define Documentation

#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.


Enumeration Type Documentation

motors struct, these are the four motor channels on the MUX

Enumerator:
MSMTRMX_M1 
MSMTRMX_M2 
MSMTRMX_M3 
MSMTRMX_M4 

Definition at line 45 of file mindsensors-rcxmotormux.h.

motor settings struct, each motor can be set to one of these modes

Enumerator:
MSMTRMX_MODE_FLOAT 
MSMTRMX_MODE_FORWARD 
MSMTRMX_MODE_REVERSE 
MSMTRMX_MODE_BRAKE 

Definition at line 37 of file mindsensors-rcxmotormux.h.


Function Documentation

bool MSMTRMX_Brake ( tSensors  link,
tMSMTRMXMotors  channel,
unsigned byte  brakeForce,
ubyte  address 
)

This function applies the specified braking power to the specified motor

Parameters:
linkport number
channelmotor number
brakeForcebrake power to set the motor to (0-255, 0 == float)
addressthe I2C address to use, optional, defaults to 0xB4
Returns:
true if message is sent successfully
Examples:
mindsensors-rcxmotormux-test1.c.

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.

Parameters:
linkport number
channelmotor number
powerspeed to set the motor to (-255 to +255)
addressthe I2C address to use, optional, defaults to 0xB4
Returns:
true if message is sent successfully
Examples:
mindsensors-rcxmotormux-test1.c.

Definition at line 69 of file mindsensors-rcxmotormux.h.


Variable Documentation

Array to hold I2C command data

Definition at line 52 of file mindsensors-rcxmotormux.h.