Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BNOWrapper
Revision 4:ecd3871549e8, committed 2019-07-29
- Comitter:
- JesiMiranda
- Date:
- Mon Jul 29 16:56:33 2019 +0000
- Parent:
- 3:24e65bfcea6d
- Child:
- 5:eefbf579d5cc
- Child:
- 6:faeba56869a5
- Commit message:
- connect ps0/1 to gnd for address 4b, address 4a does not work
Changed in this revision
| BNO080.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/BNO080.lib Sat Jul 27 00:12:40 2019 +0000 +++ b/BNO080.lib Mon Jul 29 16:56:33 2019 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/Affordable-Smart-Wheelchair/code/BNO080/#546e4553cf6d +https://os.mbed.com/teams/Affordable-Smart-Wheelchair/code/BNO080/#050dc348e690
--- a/main.cpp Sat Jul 27 00:12:40 2019 +0000
+++ b/main.cpp Mon Jul 29 16:56:33 2019 +0000
@@ -7,25 +7,19 @@
// 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
- //pc.printf("============================================================\n");
-
BNO080 imu(&pc, PB_7, PB_6, D12, PA_11, 0x4b, 400000);
- //pc.printf("==================================== Entering imu.begin ===================================\r\n");
imu.begin();
- //pc.printf("======================================EXIT & 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);
- wait(.002f);
- //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)) {
// convert quaternion to Euler degrees and print
@@ -35,15 +29,12 @@
eulerDegrees.print(pc, true);
pc.printf("\n");
}
- /*
if (imu.hasNewData(BNO080::TOTAL_ACCELERATION)) {
// print the acceleration vector using its builtin print() method
pc.printf("IMU Total Acceleration: ");
imu.totalAcceleration.print(pc, true);
pc.printf("\n");
}
- */
-
}
}