diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -7,6 +7,7 @@ #include "i2c.h" #include "itg3200.h" +#include "bma150.h" #include "usart.h" #include "xbee.h" @@ -59,6 +60,7 @@ class PID { I2C i2c; ITG3200 gyro(i2c); +BMA150 accel(i2c); void threadmain() { while(1) { @@ -71,9 +73,15 @@ void threadmain() { gyro.y >> 8, gyro.z & 0xff, gyro.z >> 8, + accel.x & 0xff, + accel.x >> 8, + accel.y & 0xff, + accel.y >> 8, + accel.z & 0xff, + accel.z >> 8, }; - xbee_send(6, buf); + xbee_send(sizeof(buf), buf); Time::sleep(100); } } @@ -104,6 +112,7 @@ int main() { //ITG3200 gyro(i2c); gyro.init(); + accel.init(); PPMSum ppmsum; ppmsum.enable(); @@ -134,6 +143,7 @@ int main() { // Read sensors. gyro.update(); + accel.update(); // Update filter. |