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

Acceleration Sensor
[HiTechnic]

Files

file  hitechnic-accelerometer.h
 

HiTechnic Acceleration Sensor driver.


Defines

#define HTAC_I2C_ADDR   0x02
#define HTAC_OFFSET   0x42
#define HTAC_X_UP   0x00
#define HTAC_Y_UP   0x01
#define HTAC_Z_UP   0x02
#define HTAC_X_LOW   0x03
#define HTAC_Y_LOW   0x04
#define HTAC_Z_LOW   0x05

Functions

bool HTACreadAllAxes (tSensors link, int &x, int &y, int &z)
bool HTACreadAllAxes (tMUXSensor muxsensor, int &x, int &y, int &z)

Variables

tConfigParams HTAC_config = {HTSMUX_CHAN_I2C, 6, 0x02, 0x42}
tByteArray HTAC_I2CRequest
tByteArray HTAC_I2CReply

Detailed Description

HiTechnic Acceleration Sensor


Define Documentation

#define HTAC_I2C_ADDR   0x02

IR Seeker I2C device address

Definition at line 52 of file hitechnic-accelerometer.h.

#define HTAC_OFFSET   0x42

Offset for data registers

Definition at line 53 of file hitechnic-accelerometer.h.

#define HTAC_X_LOW   0x03

X axis lower 2 bits

Definition at line 57 of file hitechnic-accelerometer.h.

#define HTAC_X_UP   0x00

X axis upper 8 bits

Definition at line 54 of file hitechnic-accelerometer.h.

#define HTAC_Y_LOW   0x04

Y axis lower 2 bits

Definition at line 58 of file hitechnic-accelerometer.h.

#define HTAC_Y_UP   0x01

Y axis upper 8 bits

Definition at line 55 of file hitechnic-accelerometer.h.

#define HTAC_Z_LOW   0x05

Z axis lower 2 bits

Definition at line 59 of file hitechnic-accelerometer.h.

#define HTAC_Z_UP   0x02

Z axis upper 8 bits

Definition at line 56 of file hitechnic-accelerometer.h.


Function Documentation

bool HTACreadAllAxes ( tSensors  link,
int &  x,
int &  y,
int &  z 
)

Read the value of all the axes registers return by reference

Parameters:
linkthe HTAC port number
xx axis
yy axis
zz axis
Returns:
true if no error occured, false if it did
Examples:
hitechnic-accelerometer-SMUX-test1.c, and hitechnic-accelerometer-test1.c.

Definition at line 80 of file hitechnic-accelerometer.h.

bool HTACreadAllAxes ( tMUXSensor  muxsensor,
int &  x,
int &  y,
int &  z 
)

Read the value of all the axes registers return by reference

Parameters:
muxsensorthe SMUX sensor port number
xx axis
yy axis
zz axis
Returns:
true if no error occured, false if it did

Definition at line 115 of file hitechnic-accelerometer.h.


Variable Documentation

tConfigParams HTAC_config = {HTSMUX_CHAN_I2C, 6, 0x02, 0x42}

Array to hold SMUX config data for sensor

Definition at line 66 of file hitechnic-accelerometer.h.

Array to hold I2C reply data

Definition at line 70 of file hitechnic-accelerometer.h.

Array to hold I2C command data

Definition at line 69 of file hitechnic-accelerometer.h.