ドローンユニット
Dependencies: mbed AQM0802 CRotaryEncoder TB6612FNG_Ver1
Revision 19:1765d729263e, committed 2020-01-08
- Comitter:
- 1817106
- Date:
- Wed Jan 08 02:59:55 2020 +0000
- Parent:
- 18:c13fb85f1250
- Commit message:
- test
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r c13fb85f1250 -r 1765d729263e main.cpp --- a/main.cpp Fri Dec 20 01:10:55 2019 +0000 +++ b/main.cpp Wed Jan 08 02:59:55 2020 +0000 @@ -57,9 +57,9 @@ AnalogIn s8(A0); /////ドローン定義 -//DigitalOut drone(D3); +DigitalOut drone(D3); -//int Drone = drone; +long int Drone = 0; /////////////////////////////////////// Serial PC(USBTX,USBRX); CRotaryEncoder encoder_a(D1,D0); //モータAのエンコーダ @@ -102,7 +102,7 @@ unsigned char Old_Machine_Status=0x00; //過去の機体状態 int Marker_Pass_Flag = 0; int Old_Marker_Pass_Flag=0; -int Cross_Flag2=0; +//int Cross_Flag2=0; int SG_Flag=0; int SG_Cnt=0; int Cross_Flag=0; @@ -173,6 +173,7 @@ } + //タイマ割り込み1[ms]周期 void timer_interrupt(){ @@ -332,7 +333,7 @@ lcd.locate(0,0); lcd.print("STOP"); - // Drone=0; + drone=0; wait(5); Gray=DEFAULT_GRAY; Machine_Speed=DEFAULT_SPEED; @@ -362,7 +363,7 @@ lcd.print("GO!!"); wait(2); - // Drone=1; + drone=1; Stop_Distance=0; Machine_Status&=0x7F;//ストップ状態解除 }else{//機体走行中であったとき @@ -372,7 +373,7 @@ Cross_Flag=0; Marker_Run_Distance=0;//マーカ通過距離情報リセット - // Drone=0; + drone=0; Machine_Status |= STOP;//機体停止状態にする。 lcd.locate(0,0); lcd.print(" ");