Maiko Matsumoto
/
BLE_WallbotBLE_Challenge_byYUTAKA3
6/18 wallbot
Fork of BLE_WallbotBLE_Challenge_byYUTAKA by
Diff: main.cpp
- Revision:
- 11:fcb6d8929c88
- Parent:
- 10:d443aea353a2
- Child:
- 12:252acb9c1201
--- a/main.cpp Mon Jun 18 06:18:04 2018 +0000 +++ b/main.cpp Mon Jun 18 07:15:20 2018 +0000 @@ -376,7 +376,7 @@ float buf_ax[10]; float mean_ax = 0; float sum_ax = 0; -// float log_ax[30]; + float log_ax[100]; int cnt_loop = 0; int cnt_back = 0; int cnt_straight = 0; @@ -388,6 +388,12 @@ buf_ax[i] = 0; } + + for(int i = 0; i < 100; i++) + { + log_ax[i] = 0; + } + while(sw1 != 0) { // Wait(0.1); @@ -415,6 +421,8 @@ ax = acData[0]; ay = acData[1]; + log_ax[cnt_loop] = ax; + // if(!enble_ChangeMode) // { // if(cnt_loop > 20) @@ -439,14 +447,18 @@ // } // log_ax[0] = ax; -// if(cnt_loop % 100 == 0) -// { + if(cnt_loop % 100 == 0) + { + for(int i = 0; i < 100; i++) + { + pc.printf("%5.3f, ", log_ax[i]); + } +// pc.printf("loop : %d\n", log_ax); // pc.printf("loop : %d\n", cnt_loop); // pc.printf("loop : %d\n", cnt_loop); // pc.printf("loop : %d\n", cnt_loop); // pc.printf("loop : %d\n", cnt_loop); -// pc.printf("loop : %d\n", cnt_loop); -// } + } #if 1 switch(stt_Mode)