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

dexterind-compass.h File Reference

Dexter Industries IMU Sensor driver. More...

#include "common.h"

Go to the source code of this file.

Defines

#define DIMCDAT   "dimc.dat"
#define DIMC_I2C_ADDR   0x3C
#define DIMC_REG_CONFIG_A   0x00
#define DIMC_REG_CONFIG_B   0x01
#define DIMC_REG_MODE   0x02
#define DIMC_REG_X_MSB   0x03
#define DIMC_REG_X_LSB   0x04
#define DIMC_REG_Z_MSB   0x05
#define DIMC_REG_Z_LSB   0x06
#define DIMC_REG_Y_MSB   0x07
#define DIMC_REG_Y_LSB   0x08
#define DIMC_REG_STATUS   0x09
#define DIMC_REG_IDENT_A   0x0A
#define DIMC_REG_IDENT_B   0x0B
#define DIMC_REG_IDENT_C   0x0C
#define DIMC_STATUS_LOCK   2
#define DIMC_STATUS_RDY   1
#define DIMC_MODE_CONTINUOUS   0
#define DIMC_MODE_SINGLE   1
#define DIMC_MODE_IDLE_A   2
#define DIMC_MODE_IDLE_B   3
#define DIMC_MODE_MASK   3
#define DIMC_CONF_A_SAMPLES_1   0x00
#define DIMC_CONF_A_SAMPLES_2   0x20
#define DIMC_CONF_A_SAMPLES_4   0x40
#define DIMC_CONF_A_SAMPLES_8   0x60
#define DIMC_CONF_A_SAMPLES_MASK   0x60
#define DIMC_CONF_A_RATE_0_75   0x00
#define DIMC_CONF_A_RATE_1_5   0x04
#define DIMC_CONF_A_RATE_3   0x08
#define DIMC_CONF_A_RATE_7_5   0x0C
#define DIMC_CONF_A_RATE_15   0x10
#define DIMC_CONF_A_RATE_30   0x14
#define DIMC_CONF_A_RATE_75   0x18
#define DIMC_CONF_A_RATE_RESERVED   0x1C
#define DIMC_CONF_A_RATE_MASK   0x1C
#define DIMC_CONF_A_BIAS_NORMAL   0x00
#define DIMC_CONF_A_BIAS_POSITIVE   0x01
#define DIMC_CONF_A_BIAS_NEGATIVE   0x02
#define DIMC_CONF_A_BIAS_RESERVED   0x03
#define DIMC_CONF_A_BIAS_MASK   0x03
#define DIMC_CONF_B_GAIN_0_88   0x00
#define DIMC_CONF_B_GAIN_1_3   0x20
#define DIMC_CONF_B_GAIN_1_9   0x40
#define DIMC_CONF_B_GAIN_2_5   0x60
#define DIMC_CONF_B_GAIN_4_0   0x80
#define DIMC_CONF_B_GAIN_4_7   0xA0
#define DIMC_CONF_B_GAIN_5_6   0xC0
#define DIMC_CONF_B_GAIN_8_1   0xE0
#define DIMC_CONF_B_GAIN_MASK   0xE0
#define DIMC_GAIN_SCALE_0_88   0.73
#define DIMC_GAIN_SCALE_1_3   0.92
#define DIMC_GAIN_SCALE_1_9   1.22
#define DIMC_GAIN_SCALE_2_5   1.52
#define DIMC_GAIN_SCALE_4_0   2.27
#define DIMC_GAIN_SCALE_4_7   2.56
#define DIMC_GAIN_SCALE_5_6   3.03
#define DIMC_GAIN_SCALE_8_1   4.35

Functions

bool DIMCinit (tSensors link, ubyte range, bool lpfenable=true)
bool DIMCreadAxes (tSensors link, int &_x, int &_y, int &_z)
float DIMCreadHeading (tSensors link)
void DIMCstartCal (tSensors link)
void DIMCstopCal (tSensors link)
void _DIMCreadCalVals ()
void _DIMCwriteCalVals ()
bool DIMCinit (tSensors link)

Variables

tByteArray DIMC_I2CRequest
tByteArray DIMC_I2CReply
bool DIMCcalibrating [4] = {false, false, false, false }
bool DIMCcalibrationDataLoaded = false
int DIMCminVals [4][3] = {{32767, 32767, 32767}, {32767, 32767, 32767}, {32767, 32767, 32767}, {32767, 32767, 32767}}
int DIMCmaxVals [4][3] = {{0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}}
int DIMCoffsets [4][3] = {{0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}}

Detailed Description

Dexter Industries IMU Sensor driver.

dexterind-compass.h provides an API for the Dexter Industries compass 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:
18 March 2012
Version:
0.1

Definition in file dexterind-compass.h.