Calibration program for my port of FreeIMU library. Use it with the FreeIMU Cube program or the python calibration program.
Dependencies: FreeIMU mbed-rtos mbed
Diff: main.cpp
- Revision:
- 3:cc1415081d36
- Parent:
- 2:ba8ce2dbc778
- Child:
- 4:145d1eb8a15d
--- a/main.cpp Mon Dec 23 09:42:23 2013 +0000 +++ b/main.cpp Fri Jan 10 05:52:20 2014 +0000 @@ -80,7 +80,7 @@ while(true) { int16_t raw_values[9]; - Thread::wait(10); + Thread::wait(5); char cmd = 'q'; #ifndef AUTO_OUTPUT cmd = pc.getc(); @@ -90,7 +90,7 @@ char str[256]; sprintf(str, "FreeIMU library by %s, FREQ:%s, LIB_VERSION: %s, IMU: %s", FREEIMU_DEVELOPER, 0x10000000, FREEIMU_LIB_VERSION, 0); pc.printf("%s", str); - pc.printf("\n"); + pc.printf("\r\n"); } if (cmd=='q') { @@ -109,6 +109,20 @@ Thread::yield(); } } + + if(cmd=='o') { + uint8_t count = pc.getc(); + float raw_valuesf[9]; + for(uint8_t i=0; i<count; i++) { + + imu.getValues(raw_valuesf); + + pc.printf("%f, %f, %f", raw_valuesf[3], raw_valuesf[4], raw_valuesf[5]); + + pc.printf("\r\n"); + Thread::wait(4); + } + } if(cmd=='b') { uint8_t count = pc.getc(); @@ -122,7 +136,7 @@ writeArr(raw_values, 3, sizeof(int16_t)); pc.printf("\r\n"); - wait_us(4000); + Thread::wait(4); } } }