![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
arranged by katano
Dependencies: MPU9150_DMP Neon_F303K8 QuaternionMath iSDIO mbed-rtos mbed
Fork of Neon_F303K8 by
Diff: taskSensor.cpp
- Revision:
- 1:73543a1fbe62
- Parent:
- 0:65a0ae5578da
- Child:
- 4:636bb3f66dcd
diff -r 65a0ae5578da -r 73543a1fbe62 taskSensor.cpp --- a/taskSensor.cpp Sat May 14 07:11:48 2016 +0000 +++ b/taskSensor.cpp Mon May 16 15:21:20 2016 +0000 @@ -18,7 +18,7 @@ if(imu.isReady()){ printf("MPU9150 is ready\r\n"); } else { - printf("MPU9150 initialisation failure\r\n"); + printf("MPU9150 initialization failured\r\n"); while(1){ Thread::wait(1000); } @@ -32,7 +32,7 @@ void sensor_main(void) { Quaternion q1; - pc.printf("Entered to sensor_main\r\n"); + printf("Entered to sensor_main\r\n"); float q[4]; uint8_t n = 0; uint16_t val; @@ -40,7 +40,7 @@ imu.setFifoReset(true); imu.setDMPEnabled(true); - pc.printf("sensor main loop start\r\n"); + printf("sensor main loop start\r\n"); while(true){ @@ -63,7 +63,7 @@ // 以下の#if 0~#endifを#if 1~#endifに変更すると、シリアルからセンサーの出力データが出る // 加速度センサー生値 -#if 0 +#if 1 printf("%d, %d, %d\r\n", (int32_t)(((int32_t)buffer[34] << 24) + ((int32_t)buffer[35] << 16) + ((int32_t)buffer[36] << 8) + (int32_t)buffer[37]), (int32_t)(((int32_t)buffer[38] << 24) + ((int32_t)buffer[39] << 16) + ((int32_t)buffer[40] << 8) + (int32_t)buffer[41]), (int32_t)(((int32_t)buffer[42] << 24) + ((int32_t)buffer[43] << 16) + ((int32_t)buffer[44] << 8) + (int32_t)buffer[45])); @@ -98,22 +98,22 @@ //TeaPot Demo Packet for MotionFit SDK - pc.putc('$'); //packet start - pc.putc((char)2); //assume packet type constant + putc('$'); //packet start + putc((char)2); //assume packet type constant - pc.putc(buffer[0]); - pc.putc(buffer[1]); - pc.putc(buffer[4]); - pc.putc(buffer[5]); - pc.putc(buffer[8]); - pc.putc(buffer[9]); - pc.putc(buffer[12]); - pc.putc(buffer[13]); + putc(buffer[0]); + putc(buffer[1]); + putc(buffer[4]); + putc(buffer[5]); + putc(buffer[8]); + putc(buffer[9]); + putc(buffer[12]); + putc(buffer[13]); - pc.putc((char)n++); - pc.putc((char)0); - pc.putc('\r'); - pc.putc('\n'); + putc((char)n++); + putc((char)0); + putc('\r'); + putc('\n'); #endif } else { //pc.printf("FIFO not enough\r\n");