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

dexterind-imu.h File Reference

Dexter Industries IMU Sensor driver. More...

#include "common.h"

Go to the source code of this file.

Defines

#define DIMU_GYRO_I2C_ADDR   0xD2
#define DIMU_GYRO_RANGE_250   0x00
#define DIMU_GYRO_RANGE_500   0x10
#define DIMU_GYRO_RANGE_2000   0x30
#define DIMU_CTRL4_BLOCKDATA   0x80
#define DIMU_GYRO_CTRL_REG1   0x20
#define DIMU_GYRO_CTRL_REG2   0x21
#define DIMU_GYRO_CTRL_REG3   0x22
#define DIMU_GYRO_CTRL_REG4   0x23
#define DIMU_GYRO_CTRL_REG5   0x24
#define DIMU_GYRO_ALL_AXES   0x28
#define DIMU_GYRO_X_AXIS   0x2A
#define DIMU_GYRO_Y_AXIS   0x28
#define DIMU_GYRO_Z_AXIS   0x2C
#define DIMU_ACC_I2C_ADDR   0x3A
#define DIMU_ACC_RANGE_2G   0x04
#define DIMU_ACC_RANGE_4G   0x08
#define DIMU_ACC_RANGE_8G   0x00
#define DIMU_ACC_MODE_STBY   0x00
#define DIMU_ACC_MODE_MEAS   0x01
#define DIMU_ACC_MODE_LVLD   0x02
#define DIMU_ACC_MODE_PLSE   0x03
#define DIMU_ACC_X_AXIS   0x00
#define DIMU_ACC_Y_AXIS   0x02
#define DIMU_ACC_Z_AXIS   0x04
#define DIMUreadGyroXAxis(X)   DIMUreadGyroAxis(X, DIMU_GYRO_X_AXIS)
#define DIMUreadGyroYAxis(X)   DIMUreadGyroAxis(X, DIMU_GYRO_Y_AXIS)
#define DIMUreadGyroZAxis(X)   DIMUreadGyroAxis(X, DIMU_GYRO_Z_AXIS)
#define DIMUreadAccelXAxis10Bit(X)   DIMUreadAccelAxis10Bit(X, DIMU_ACC_X_AXIS)
#define DIMUreadAccelYAxis10Bit(X)   DIMUreadAccelAxis10Bit(X, DIMU_ACC_Y_AXIS)
#define DIMUreadAccelZAxis10Bit(X)   DIMUreadAccelAxis10Bit(X, DIMU_ACC_Z_AXIS)
#define DIMUreadAccelXAxis8Bit(X)   DIMUreadAccelAxis8Bit(X, DIMU_ACC_X_AXIS)
#define DIMUreadAccelYAxis8Bit(X)   DIMUreadAccelAxis8Bit(X, DIMU_ACC_Y_AXIS)
#define DIMUreadAccelZAxis8Bit(X)   DIMUreadAccelAxis8Bit(X, DIMU_ACC_Z_AXIS)

Functions

bool DIMUconfigGyro (tSensors link, ubyte range, bool lpfenable=true)
float DIMUreadGyroAxis (tSensors link, ubyte axis)
void DIMUreadGyroAxes (tSensors link, float &_x, float &_y, float &_z)
bool DIMUconfigAccel (tSensors link, ubyte range)
float DIMUreadAccelAxis8Bit (tSensors link, ubyte axis)
bool DIMUsetAccelAxisOffset (tSensors link, ubyte drift_reg, ubyte drift_LSB, ubyte drift_MSB)
float DIMUreadAccelAxis10Bit (tSensors link, ubyte axis, bool calibrate=false)
void DIMUreadAccelAxes8Bit (tSensors link, float &_x, float &_y, float &_z)
void DIMUreadAccelAxes10Bit (tSensors link, float &_x, float &_y, float &_z)
void DIMUcalAccel (tSensors link)
bool DIMUconfigIMU (tSensors link, ubyte accelRange=DIMU_ACC_RANGE_8G, ubyte gyroRange=DIMU_GYRO_RANGE_250, bool lpfenable=true)

Variables

float DIMU_Gyro_divisor [4] = {0.0, 0.0, 0.0, 0.0}
float DIMU_Accel_divisor [4] = {0.0, 0.0, 0.0, 0.0}
tByteArray DIMU_I2CRequest
tByteArray DIMU_I2CReply

Detailed Description

Dexter Industries IMU Sensor driver.

dexterind-imu.h provides an API for the Dexter Industries IMU Sensor.

Changelog:

Credits:

License: You may use this code as you wish, provided you give credit where its due.

THIS CODE WILL ONLY WORK WITH ROBOTC VERSION 3.59 AND HIGHER.

Author:
Xander Soldaat (xander_at_botbench.com)
Date:
07 August 2011
Version:
0.1

Definition in file dexterind-imu.h.