Implemented first Hangar-Service
Dependencies: CalibrateMagneto QuaternionMath
Fork of SML2 by
Diff: Magnetometer.cpp
- Revision:
- 40:8e852115fe55
- Parent:
- 34:01dec68de3ed
- Child:
- 46:fd5a62296b12
--- a/Magnetometer.cpp Tue May 19 14:18:30 2015 +0000 +++ b/Magnetometer.cpp Tue May 26 11:28:37 2015 +0000 @@ -70,11 +70,11 @@ { // Refer to https://github.com/kriswiner/BMX-055/blob/master/BMX055_MS5637_BasicAHRS_t3.ino#L790 uint8_t buffer[8]; - + /* for (size_t i = 0; i < sizeof buffer; i++) buffer[i] = read_reg(0x42 + i); - - //read_reg(0x40, buffer, 4); + */ + read_reg(0x42, buffer, sizeof buffer); // Datasheet is wrong, BMX055 magneto x and y axis are interchanged and y axis is inverted !!! const int16_t mdata_y = *(reinterpret_cast<const int16_t*>(buffer + 0)) / 8;