added main and defined M_PI
Dependencies: BNOWrapper
Diff: main.cpp
- Revision:
- 2:1fd1549d3fbd
- Parent:
- 1:4a5b43b9502c
- Child:
- 3:24e65bfcea6d
diff -r 4a5b43b9502c -r 1fd1549d3fbd main.cpp --- a/main.cpp Thu Jul 18 22:09:22 2019 +0000 +++ b/main.cpp Mon Jul 22 18:54:39 2019 +0000 @@ -1,28 +1,29 @@ #include <mbed.h> #include <BNO080.h> - + int main() { - Serial pc(USBTX, USBRX); + Serial pc(USBTX, USBRX, 9600); // Create IMU, passing in output stream, pins, I2C address, and I2C frequency // These pin assignments are specific to my dev setup -- you'll need to change them - BNO080 imu(&pc, D0, D1, D3, D4, 0x4a, 100000); + BNO080 imu(&pc, PB_7 , PB_6, PB_0, D10, 0x4b, 400000); - pc.baud(9600); pc.printf("============================================================\n"); - + imu.begin(); + pc.printf("======================================ENABLING REPORT FOR IMU==========================================================\r\n"); // Tell the IMU to report rotation every 100ms and acceleration every 200ms imu.enableReport(BNO080::ROTATION, 100); imu.enableReport(BNO080::TOTAL_ACCELERATION, 200); - + pc.printf("======================================DONE ENABLING REPORT FOR IMU ===================================================\r\n"); + pc.printf("========================= STUCK INSIDE THE WHILE LOOP ===============================\r\n"); while (true) - { + { wait(.001f); - // poll the IMU for new data -- this returns true if any packets were received if(imu.updateData()) { + pc.printf("======================================= INSIDE IMU.UPDATEDATA() =================================\r\n"); // now check for the specific type of data that was received (can be multiple at once) if (imu.hasNewData(BNO080::ROTATION)) {