A class to interface with the ITG3200 gyroscope (untested)
More...
#include <ITG3200.h>
A class to interface with the ITG3200 gyroscope (untested)
exploringBB::ITG3200::ITG3200 |
( |
BusDevice * |
device | ) |
|
60 this->device = device;
61 for (
int i=0; i<3; i++) {
62 this->gyroscope[i] = 0.0;
63 this->offsets[i] = 0.0;
65 this->registers = NULL;
66 this->temperature = 0;
int readFullSensorState()
Definition: ITG3200.cpp:70
exploringBB::ITG3200::~ITG3200 |
( |
| ) |
|
|
virtual |
int exploringBB::ITG3200::convertGyroscopeValue |
( |
int |
msb_reg_addr, |
|
|
int |
lsb_reg_addr |
|
) |
| |
84 short temp = *(registers+msb_reg_addr);
85 temp = (temp<<8) | *(registers+lsb_reg_addr);
float exploringBB::ITG3200::getGyroscopePitch |
( |
| ) |
|
|
inline |
#define SENSITIVITY
Definition: ITG3200.h:31
float exploringBB::ITG3200::getGyroscopeRoll |
( |
| ) |
|
|
inline |
#define SENSITIVITY
Definition: ITG3200.h:31
float exploringBB::ITG3200::getGyroscopeYaw |
( |
| ) |
|
|
inline |
#define SENSITIVITY
Definition: ITG3200.h:31
float exploringBB::ITG3200::getOffsetPitchOffset |
( |
| ) |
|
|
inline |
#define SENSITIVITY
Definition: ITG3200.h:31
float exploringBB::ITG3200::getOffsetRollOffset |
( |
| ) |
|
|
inline |
#define SENSITIVITY
Definition: ITG3200.h:31
float exploringBB::ITG3200::getOffsetYawOffset |
( |
| ) |
|
|
inline |
#define SENSITIVITY
Definition: ITG3200.h:31
int exploringBB::ITG3200::getTemperature |
( |
| ) |
|
|
inline |
72 {
return temperature; }
int exploringBB::ITG3200::readFullSensorState |
( |
| ) |
|
72 if(*this->registers!=0x69){
73 perror(
"ITG3200: Failure Condition - Sensor ID not Verified");
int convertGyroscopeValue(int msb_reg_addr, int lsb_reg_addr)
Definition: ITG3200.cpp:83
#define GYRO_Y_MSB
Definition: ITG3200.cpp:41
#define GYRO_X_MSB
Definition: ITG3200.cpp:39
#define TEMP_LSB
Definition: ITG3200.cpp:46
#define GYRO_Z_MSB
Definition: ITG3200.cpp:43
#define GYRO_X_LSB
Definition: ITG3200.cpp:40
#define BUFFER_SIZE
The ADXL345 has 0x40 registers (0x01 to 0x1C are reserved and should not be accessed) ...
Definition: ADXL345.h:31
#define TEMP_MSB
Definition: ITG3200.cpp:45
#define GYRO_Z_LSB
Definition: ITG3200.cpp:44
virtual unsigned char * readRegisters(unsigned int number, unsigned int fromAddress=0)=0
#define GYRO_Y_LSB
Definition: ITG3200.cpp:42
int exploringBB::ITG3200::setDigitalLowPassFilter |
( |
ITG3200_LPFILTER |
filterValue | ) |
|
92 char temp = 0b00011000;
93 temp = temp | filterValue;
95 cout <<
"Failure to update ITG3200 DLPF_FS value" << endl;
#define DLPF_FS
Definition: ITG3200.cpp:52
virtual int writeRegister(unsigned int registerAddress, unsigned char value)=0
int exploringBB::ITG3200::setSampleRateDivider |
( |
char |
divider | ) |
|
123 cout <<
"Failure to update ITG3200 SMPLRT_DIV value" << endl;
#define SMPLRT_DIV
Definition: ITG3200.cpp:50
virtual int writeRegister(unsigned int registerAddress, unsigned char value)=0
int exploringBB::ITG3200::zeroCalibrate |
( |
int |
numberSamples, |
|
|
int |
sampleDelayMs |
|
) |
| |
103 double total[3] = {0.0, 0.0, 0.0};
104 for(
int i=0; i<numberSamples; i++){
106 for(
int j=0; j<3; j++){
107 total[j] = total[j] + this->gyroscope[j];
109 usleep(sampleDelayMs*1000);
111 for(
int i=0; i<=2; i++) {
112 this->offsets[i] = total[i]/numberSamples;
int readFullSensorState()
Definition: ITG3200.cpp:70
The documentation for this class was generated from the following files:
- /home/molloyd/exploringBB/library/sensor/ITG3200.h
- /home/molloyd/exploringBB/library/sensor/ITG3200.cpp