A class to control a BMA180 accelerometer (untested)
More...
#include <BMA180.hxx>
A class to control a BMA180 accelerometer (untested)
exploringBB::BMA180::BMA180 |
( |
BusDevice * |
device | ) |
|
44 this->device = device;
int readFullSensorState()
Definition: BMA180.cxx:56
virtual exploringBB::BMA180::~BMA180 |
( |
| ) |
|
|
virtual |
void exploringBB::BMA180::displayMode |
( |
int |
iterations | ) |
|
81 for(
int i=0; i<iterations; i++){
83 printf(
"Rotation (%d, %d, %d)", accelerationX, accelerationY, accelerationZ);
int readFullSensorState()
Definition: BMA180.cxx:56
int exploringBB::BMA180::getAccelerationX |
( |
| ) |
|
|
inline |
100 {
return accelerationX; }
int exploringBB::BMA180::getAccelerationY |
( |
| ) |
|
|
inline |
101 {
return accelerationY; }
int exploringBB::BMA180::getAccelerationZ |
( |
| ) |
|
|
inline |
102 {
return accelerationZ; }
BMA180::BANDWIDTH exploringBB::BMA180::getBandwidth |
( |
| ) |
|
144 temp = temp & 0b11110000;
147 this->bandwidth = (BMA180::BANDWIDTH) temp;
148 return this->bandwidth;
int readFullSensorState()
Definition: BMA180.cxx:56
#define BMA_BANDWIDTH
Definition: BMA180.cxx:38
BMA180::MODECONFIG exploringBB::BMA180::getModeConfig |
( |
| ) |
|
169 temp = temp & 0b00000011;
170 this->modeConfig = (BMA180::MODECONFIG) temp;
171 return this->modeConfig;
int readFullSensorState()
Definition: BMA180.cxx:56
#define MODE_CONFIG
Definition: BMA180.cxx:39
float exploringBB::BMA180::getPitch |
( |
| ) |
|
|
inline |
BMA180::RANGE exploringBB::BMA180::getRange |
( |
| ) |
|
118 temp = temp & 0b00001110;
121 this->range = (BMA180::RANGE) temp;
int readFullSensorState()
Definition: BMA180.cxx:56
#define BMA_RANGE
Definition: BMA180.cxx:37
float exploringBB::BMA180::getRoll |
( |
| ) |
|
|
inline |
float exploringBB::BMA180::getTemperature |
( |
| ) |
|
101 temp = ~temp + 0b00000001;
102 temperature = 128 - temp;
105 temperature = 128 + temp;
107 this->temperature = offset + ((float)temperature*0.5f);
111 return this->temperature;
int readFullSensorState()
Definition: BMA180.cxx:56
#define BMA_TEMP
Definition: BMA180.cxx:36
int exploringBB::BMA180::readFullSensorState |
( |
| ) |
|
58 if(*this->registers!=0x03){
59 perror(
"BMA180: Failure Condition - Sensor ID not Verified");
65 this->calculatePitchAndRoll();
#define ACC_X_MSB
Definition: BMA180.cxx:31
#define ACC_Z_MSB
Definition: BMA180.cxx:35
#define BUFFER_SIZE
The ADXL345 has 0x40 registers (0x01 to 0x1C are reserved and should not be accessed) ...
Definition: ADXL345.h:31
#define ACC_Y_LSB
Definition: BMA180.cxx:32
#define ACC_Y_MSB
Definition: BMA180.cxx:33
#define ACC_X_LSB
Definition: BMA180.cxx:30
#define ACC_Z_LSB
Definition: BMA180.cxx:34
virtual unsigned char * readRegisters(unsigned int number, unsigned int fromAddress=0)=0
int exploringBB::BMA180::setBandwidth |
( |
BMA180::BANDWIDTH |
bandwidth | ) |
|
154 char temp = bandwidth << 4;
155 current = current & 0b00001111;
156 temp = current | temp;
158 perror(
"Failure to update BANDWIDTH value\n");
int readFullSensorState()
Definition: BMA180.cxx:56
#define BMA_BANDWIDTH
Definition: BMA180.cxx:38
virtual int writeRegister(unsigned int registerAddress, unsigned char value)=0
int exploringBB::BMA180::setModeConfig |
( |
BMA180::MODECONFIG |
mode | ) |
|
int exploringBB::BMA180::setRange |
( |
BMA180::RANGE |
range | ) |
|
129 char temp = range << 1;
130 current = current & 0b11110001;
131 temp = current | temp;
133 perror(
"Failure to update RANGE value\n");
int readFullSensorState()
Definition: BMA180.cxx:56
#define BMA_RANGE
Definition: BMA180.cxx:37
virtual int writeRegister(unsigned int registerAddress, unsigned char value)=0
The documentation for this class was generated from the following files:
- /home/molloyd/exploringBB/library/sensor/BMA180.hxx
- /home/molloyd/exploringBB/library/sensor/BMA180.cxx