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: MPU9250_SPI mbed
Diff: main.cpp
- Revision:
- 20:01bba4071ffc
- Parent:
- 19:3fc0ecfc723a
- Child:
- 21:06a9547359dc
--- a/main.cpp Tue Jun 28 13:41:15 2016 +0000 +++ b/main.cpp Tue Jun 28 13:46:58 2016 +0000 @@ -75,16 +75,18 @@ // Wada June 17, 2016 void float2byte(float gq, float k)//k = gyro_divider 32.8 or q_divider 32800 { + int tmp; float omegaF = gq * k; int16_t omegaI = (int16_t)omegaF; if(omegaI < 0){//1の補数 omegaI = 0xFFFF + omegaI; } - for(i=0;i<4;i++){ + for(int i=0;i<4;i++){ tmp = (0xF & (omegaI >> (i*4))); #ifdef DEBUG_putc pc.putc(tmp); #endif + wait_us(150); } }//float2byte @@ -114,7 +116,8 @@ ); #ifdef DEBUG_putc pc.putc(0x34); //STX - #endif + #endif + wait_us(150); for(int i=0; i<2; i++) { /* printf("%+1.3f,%+1.3f,%+1.3f,",