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

RCX Sensor MUX
[Mindsensors]

Files

file  MSRXMUX-driver.h
 

Mindsensors MSRXMUX RCX Sensor MUX Sensor driver.


Defines

#define MSRXMUX_I2C_ADDR   0x7E
#define MSRXMUX_CHAN1   0xFE
#define MSRXMUX_CHAN2   0xFD
#define MSRXMUX_CHAN3   0xFB
#define MSRXMUX_CHAN4   0xF7
#define MSRXMUX_NONE   0xFF

Functions

void MSRXMUXsetupChan (tSensors link, ubyte chan, TSensorTypes chantype, TSensorModes chanmode, ubyte delay)
int MSRXMUXreadChan (tSensors link, byte chan)

Variables

tByteArray MSRXMUX_I2CRequest
TSensorTypes RCXSensorTypes [4][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}
TSensorModes RCXSensorModes [4][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}
ubyte RCXSensorDelays [4][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}

Detailed Description

RCX Sensor MUX


Define Documentation

#define MSRXMUX_CHAN1   0xFE

Select MUX channel 1

Definition at line 42 of file MSRXMUX-driver.h.

#define MSRXMUX_CHAN2   0xFD

Select MUX channel 2

Definition at line 43 of file MSRXMUX-driver.h.

#define MSRXMUX_CHAN3   0xFB

Select MUX channel 3

Definition at line 44 of file MSRXMUX-driver.h.

#define MSRXMUX_CHAN4   0xF7

Select MUX channel 4

Definition at line 45 of file MSRXMUX-driver.h.

#define MSRXMUX_I2C_ADDR   0x7E

I2C address for sensor

Definition at line 41 of file MSRXMUX-driver.h.

#define MSRXMUX_NONE   0xFF

Deselect all MUX channels

Definition at line 46 of file MSRXMUX-driver.h.


Function Documentation

int MSRXMUXreadChan ( tSensors  link,
byte  chan 
)
Examples:
MSRXMUX-test1.c.

Definition at line 74 of file MSRXMUX-driver.h.

void MSRXMUXsetupChan ( tSensors  link,
ubyte  chan,
TSensorTypes  chantype,
TSensorModes  chanmode,
ubyte  delay 
)

Send a direct command to the PFMate sensor

Note: this is an internal command and should not be called directly.

Parameters:
linkthe PFMate port number
chanthe channel to be configured
chantypethe sensor type connected to the channel
chanmodethe sensor mode of the sensor
delaythe initialisation delay time
Returns:
true if no error occured, false if it did
Examples:
MSRXMUX-test1.c.

Definition at line 65 of file MSRXMUX-driver.h.


Variable Documentation

Array to hold I2C command data

Definition at line 48 of file MSRXMUX-driver.h.

ubyte RCXSensorDelays[4][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}

Definition at line 52 of file MSRXMUX-driver.h.

TSensorModes RCXSensorModes[4][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}

Definition at line 51 of file MSRXMUX-driver.h.

TSensorTypes RCXSensorTypes[4][4] = {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}

Definition at line 50 of file MSRXMUX-driver.h.