Implemented first Hangar-Service
Dependencies: CalibrateMagneto QuaternionMath
Fork of SML2 by
Diff: Gyroscope.cpp
- Revision:
- 4:e759b8c756da
- Child:
- 5:b9f2f62a8f90
diff -r ee90a9ada112 -r e759b8c756da Gyroscope.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Gyroscope.cpp Fri Jan 23 13:00:46 2015 +0000 @@ -0,0 +1,16 @@ +#include "Gyroscope.h" +#define DEBUG "BMX055-Gyr" +#include "Logger.h" + +Gyroscope::Gyroscope(I2C &i2c) : I2CPeripheral(i2c, 0x69 << 1 /* address */) { + write_reg(0x14, 0xB6); // reset + wait_ms(30); // page 14 + + const uint8_t chip_id = read_reg(0x00); + if (chip_id == 0x0f) { + INFO("Bosch Sensortec BMX055-Gyro ready"); + } else { + WARN("Bosch Sensortec BMX055-Gyro not found (chip ID=0x%02x, expected=0x0f)", chip_id); + } +} +