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

CruizCore XG1300L Sensor
[Other]

Files

file  microinfinity-cruizcore.h
 

MicroInfinity CruizCore XG1300L driver.


Defines

#define MICC_I2C_ADDR   0x02
#define MICC_ACC_ANG   0x42
#define MICC_TURN_RATE   0x44
#define MICC_X_ACCEL   0x46
#define MICC_Y_ACCEL   0x48
#define MICC_Z_ACCEL   0x4A
#define MICC_CMD_RESET   0x60
#define MICC_CMD_RANGE_2G   0x61
#define MICC_CMD_RANGE_4G   0x62
#define MICC_CMD_RANGE_8G   0x63
#define MICCsetRange2G(x)   MICCsendCmd(x, MICC_CMD_RANGE_2G)
#define MICCsetRange4G(x)   MICCsendCmd(x, MICC_CMD_RANGE_4G)
#define MICCsetRange8G(x)   MICCsendCmd(x, MICC_CMD_RANGE_8G)
#define MICCreset(x)   MICCsendCmd(x, MICC_CMD_RESET)

Functions

int MICCreadRelativeHeading (tSensors link)
int MICCreadTurnRate (tSensors link)
bool MICCreadAccel (tSensors link, int &x_accel, int &y_accel, int &z_accel)
bool MICCsendCmd (tSensors link, ubyte command)

Variables

tByteArray MICC_I2CRequest
tByteArray MICC_I2CReply

Detailed Description

CruizCore XG1300L


Define Documentation

#define MICC_ACC_ANG   0x42

MICC Accumulated angle (2 bytes)

Definition at line 44 of file microinfinity-cruizcore.h.

#define MICC_CMD_RANGE_2G   0x61

MICC Acceleration up to 2G

Definition at line 53 of file microinfinity-cruizcore.h.

#define MICC_CMD_RANGE_4G   0x62

MICC Acceleration up to 4G

Definition at line 54 of file microinfinity-cruizcore.h.

#define MICC_CMD_RANGE_8G   0x63

MICC Acceleration up to 8G

Definition at line 55 of file microinfinity-cruizcore.h.

#define MICC_CMD_RESET   0x60

MICC Reset the device

Definition at line 52 of file microinfinity-cruizcore.h.

#define MICC_I2C_ADDR   0x02

MICC I2C device address

Definition at line 42 of file microinfinity-cruizcore.h.

#define MICC_TURN_RATE   0x44

MICC Rate of Turn (2 bytes)

Definition at line 46 of file microinfinity-cruizcore.h.

#define MICC_X_ACCEL   0x46

MICC X acceleration data (2 bytes)

Definition at line 48 of file microinfinity-cruizcore.h.

#define MICC_Y_ACCEL   0x48

MICC Y acceleration data (2 bytes)

Definition at line 49 of file microinfinity-cruizcore.h.

#define MICC_Z_ACCEL   0x4A

MICC Z acceleration data (2 bytes)

Definition at line 50 of file microinfinity-cruizcore.h.

#define MICCreset (   x )    MICCsendCmd(x, MICC_CMD_RESET)

Macro for resetting sensor

Examples:
microinfinity-cruizcore-test1.c, and microinfinity-cruizcore-test2.c.

Definition at line 65 of file microinfinity-cruizcore.h.

#define MICCsetRange2G (   x )    MICCsendCmd(x, MICC_CMD_RANGE_2G)

Macro for setting sensor to 2G range

Definition at line 62 of file microinfinity-cruizcore.h.

#define MICCsetRange4G (   x )    MICCsendCmd(x, MICC_CMD_RANGE_4G)

Macro for setting sensor to 4G range

Definition at line 63 of file microinfinity-cruizcore.h.

#define MICCsetRange8G (   x )    MICCsendCmd(x, MICC_CMD_RANGE_8G)

Macro for setting sensor to 8G range

Examples:
microinfinity-cruizcore-test1.c, and microinfinity-cruizcore-test2.c.

Definition at line 64 of file microinfinity-cruizcore.h.


Function Documentation

bool MICCreadAccel ( tSensors  link,
int &  x_accel,
int &  y_accel,
int &  z_accel 
)

Read acceleration data from the sensor

Parameters:
linkthe sensor port number
x_accelX acceleration data
y_accelY acceleration data
z_accelZ acceleration data
Returns:
true if no error occured, false if it did
Examples:
microinfinity-cruizcore-test1.c, and microinfinity-cruizcore-test2.c.

Definition at line 117 of file microinfinity-cruizcore.h.

int MICCreadRelativeHeading ( tSensors  link )

Return the current relative heading, value between -179 and 180 degrees.
Angle is measured in 100th degrees. So 12899 = 128.99 degrees.

Returns:
the relative heading
Examples:
microinfinity-cruizcore-test1.c, and microinfinity-cruizcore-test2.c.

Definition at line 76 of file microinfinity-cruizcore.h.

int MICCreadTurnRate ( tSensors  link )

Return the Rate of Turn in degrees per second

Returns:
the current rate of turn
Examples:
microinfinity-cruizcore-test1.c, and microinfinity-cruizcore-test2.c.

Definition at line 95 of file microinfinity-cruizcore.h.

bool MICCsendCmd ( tSensors  link,
ubyte  command 
)

Send a command to the sensor

Parameters:
linkthe sensor port number
commandthe command to be sent
Returns:
true if no error occured, false if it did

Definition at line 141 of file microinfinity-cruizcore.h.


Variable Documentation

Array to hold I2C reply data

Definition at line 68 of file microinfinity-cruizcore.h.

Array to hold I2C command data

Definition at line 67 of file microinfinity-cruizcore.h.