Dependencies: BNO055_fusion_tom FastPWM mbed
Fork of NucleoCube1 by
Diff: cube.cpp
- Revision:
- 24:c7b3bac429c5
- Parent:
- 23:abe76b7c377a
- Child:
- 26:f2bb916262c9
--- a/cube.cpp Wed Apr 12 00:29:45 2017 +0000 +++ b/cube.cpp Wed Apr 12 20:54:52 2017 +0000 @@ -9,6 +9,22 @@ */ #include "cube.h" + +void checkCalib(BNO055 *imu, Serial *pc) { + pc->printf("Checking calibration status...\r\n"); + int stat = imu->read_calib_status(); + while(stat < 192) { + pc->printf("Sys:%d Gyr:%d Acc:%d Mag:%d\r\n", + (stat >> 6) & 0x03, + (stat >> 4) & 0x03, + (stat >> 2) & 0x03, + stat & 0x03); + wait_ms(250); + stat = imu->read_calib_status(); + } + pc->printf("Looks good buddy, put the cube down now.\r\n"); + wait(5); +} /* * Returns PWM duty cycle based on: