走行1回目デフォルト 走行2回目記憶走行
Dependencies: mbed AQM0802 CRotaryEncoder TB6612FNG
Diff: main.cpp
- Revision:
- 2:a28ca7c25ed1
- Parent:
- 1:19e2241a7aa7
- Child:
- 3:e455433c8cae
--- 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);//表示