Implemented first Hangar-Service
Dependencies: CalibrateMagneto QuaternionMath
Fork of SML2 by
Diff: Gyroscope.cpp
- Revision:
- 39:1fa9c0e1ffde
- Parent:
- 32:d37447aec6b4
- Child:
- 40:8e852115fe55
diff -r 63d355f2cf6a -r 1fa9c0e1ffde Gyroscope.cpp --- a/Gyroscope.cpp Wed May 13 13:41:57 2015 +0000 +++ b/Gyroscope.cpp Tue May 19 14:18:30 2015 +0000 @@ -4,7 +4,7 @@ #include "Vector3.h" -Gyroscope::Gyroscope(I2C &i2c) : I2CPeripheral(i2c, 0x69 << 1 /* address */), int1(p3), int2(p1) +Gyroscope::Gyroscope(I2C &i2c) : I2CPeripheral(i2c, 0x69 << 1 /* address */), int1(p3), int2(p1), tick(0) { if (powerOn()) { INFO("Bosch Sensortec BMX055-Gyro found"); @@ -39,6 +39,7 @@ write_reg(0x16, 5); // interrupts active high, push-pull write_reg(0x18, 1 << 0); // map new data interrupt to INT3 pin (1st interrupt for gyro) int1.rise(this, &Gyroscope::handleInterrupt); + tick = 1; write_reg(0x15, 1 << 7); // new data interrupt enabled }