![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
20160812
Dependencies: SDFileSystem mbed
Fork of keiki20160527 by
Diff: main.cpp
- Revision:
- 7:9415448ae9ca
- Parent:
- 6:98a63127aa11
- Child:
- 8:31e07f6ed0f7
diff -r 98a63127aa11 -r 9415448ae9ca main.cpp --- a/main.cpp Fri May 13 07:31:18 2016 +0000 +++ b/main.cpp Fri May 20 12:26:32 2016 +0000 @@ -81,8 +81,8 @@ kisokuServo.period_ms(INIT_SERVO_PERIOD_MS); geikakuServo.period_ms(INIT_SERVO_PERIOD_MS); FusokukeiInit(); - MpuInit(); - SdInit(); + //MpuInit(); + //SdInit(); //writeDatasTicker.attach(&WriteDatas,1); //soudaSerial.attach(&DataReceiveFromSouda, Serial::RxIrq); } @@ -199,31 +199,32 @@ } void WriteDatas(){ - int i; - for(i = 0; i < SOUDA_DATAS_NUM; i++){ - writeDatas[write_datas_index][i] = (float)soudaDatas[i]; - } - writeDatas[write_datas_index][i++] = calcKXdeg(kx_X.read()); - writeDatas[write_datas_index][i++] = calcKXdeg(kx_Y.read()); - writeDatas[write_datas_index][i++] = calcKXdeg(kx_Z.read()); - writeDatas[write_datas_index][i++] = pitch; - writeDatas[write_datas_index][i++] = roll; - writeDatas[write_datas_index][i++] = yaw; - writeDatas[write_datas_index][i++] = airSpeed; - //writeDatas[write_datas_index][i++] = writeTimer.read(); - for(i = 0; i < WRITE_DATAS_NUM; i++){ - pc.printf("%f ", writeDatas[write_datas_index][i]); - twe.printf("%f,", writeDatas[write_datas_index][i]); - } - pc.printf("\n\r"); - twe.printf("\n\r"); - if(write_datas_index == SD_WRITE_NUM-1){ - SDprintf(); - write_datas_index=0; - } - else{ - write_datas_index++; - } + pc.printf("%f\n\r",airSpeed); + //int i; +// for(i = 0; i < SOUDA_DATAS_NUM; i++){ +// writeDatas[write_datas_index][i] = (float)soudaDatas[i]; +// } +// writeDatas[write_datas_index][i++] = calcKXdeg(kx_X.read()); +// writeDatas[write_datas_index][i++] = calcKXdeg(kx_Y.read()); +// writeDatas[write_datas_index][i++] = calcKXdeg(kx_Z.read()); +// writeDatas[write_datas_index][i++] = pitch; +// writeDatas[write_datas_index][i++] = roll; +// writeDatas[write_datas_index][i++] = yaw; +// writeDatas[write_datas_index][i++] = airSpeed; +// //writeDatas[write_datas_index][i++] = writeTimer.read(); +// for(i = 0; i < WRITE_DATAS_NUM; i++){ +// pc.printf("%f ", writeDatas[write_datas_index][i]); +// twe.printf("%f,", writeDatas[write_datas_index][i]); +// } +// pc.printf("\n\r"); +// twe.printf("\n\r"); + //if(write_datas_index == SD_WRITE_NUM-1){ +// SDprintf(); +// write_datas_index=0; +// } +// else{ +// write_datas_index++; +// } //for(int i = 0; i < SOUDA_DATAS_NUM; i++){ // pc.printf("%i ",soudaDatas[i]); // twe.printf("%i ",soudaDatas[i]); @@ -275,10 +276,10 @@ int main(){ init(); while(1){ - mpuProcessing(); - RollAlarm(); - DataReceiveFromSouda(); + //uProcessing(); + // RollAlarm(); + //taReceiveFromSouda(); WriteDatas(); - WriteServo(); + //iteServo(); } } \ No newline at end of file