1
0
forked from me/IronOS

Include some bias removal based on the target temp to linearise the response a bit more

This commit is contained in:
Ben V. Brown
2020-12-29 10:44:39 +11:00
parent 27bf2a1711
commit a3f037fd1d
3 changed files with 77 additions and 64 deletions

View File

@@ -39,7 +39,7 @@ bool BMA223::initalize() {
}
void BMA223::getAxisReadings(int16_t& x, int16_t& y, int16_t& z) {
void BMA223::getAxisReadings(int16_t &x, int16_t &y, int16_t &z) {
//The BMA is odd in that its output data width is only 8 bits
//And yet there are MSB and LSB registers _sigh_.
uint8_t sensorData[6] = { 0, 0, 0, 0, 0, 0 };
@@ -48,9 +48,9 @@ void BMA223::getAxisReadings(int16_t& x, int16_t& y, int16_t& z) {
x = y = z = 0;
return;
}
x = sensorData[1] << 5;
y = sensorData[3] << 5;
z = sensorData[5] << 5;
//Shift 6 to make its range ~= the other accelerometers
x = sensorData[1] << 6;
y = sensorData[3] << 6;
z = sensorData[5] << 6;
}