機体走行距離計測のテストプログラム。 機体を手で押し、実際の走行距離と表示走行距離を PALSE_TO_UMの調整で合わせること。
Dependencies: mbed CRotaryEncoder
Revision 2:a28ca7c25ed1, committed 2019-08-26
- Comitter:
- yusaku0125
- Date:
- Mon Aug 26 04:57:20 2019 +0000
- Parent:
- 1:19e2241a7aa7
- Commit message:
- test;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 19e2241a7aa7 -r a28ca7c25ed1 main.cpp --- a/main.cpp Mon Aug 26 04:55:44 2019 +0000 +++ b/main.cpp Mon Aug 26 04:57:20 2019 +0000 @@ -18,7 +18,7 @@ while(1) { enc_count_a=encoder_a.Get(); //エンコーダパルス数を取得 - enc_count_b=encoder_b.Get(); + enc_count_b=-encoder_b.Get(); distance_a=(enc_count_a*PULSE_TO_UM)/1000; //移動距離をmm単位で格納 distance_b=(enc_count_b*PULSE_TO_UM)/1000; PC.printf("dis_a:%d dis_b:%d\r\n",distance_a,distance_b);//表示