![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
2016_05_19 Auto mode: 10sec forward, 2sec stop, 2sec turn right Please change test Auto pwm
Dependencies: ADXL345 AigamozuControlPackets_2016 HMC5843 ITG3200 MBed_Adafruit-GPS-Library XBee agzIDLIST_2016 mbed
Fork of Aigamozu_Robot_ver4 by
Diff: main.cpp
- Revision:
- 30:7f6ebe2121d9
- Parent:
- 29:524684a1198f
- Child:
- 31:3f91f4bfca8a
diff -r 524684a1198f -r 7f6ebe2121d9 main.cpp --- a/main.cpp Tue May 19 10:27:43 2015 +0000 +++ b/main.cpp Tue May 19 10:52:39 2015 +0000 @@ -429,7 +429,7 @@ //interrupt start refresh_Timer.start(); auto_Timer.start(); - Move_Timer.start(); + agz.Move_Timer.start(); collect_Timer.start(); printf("start\n"); @@ -464,6 +464,7 @@ } case CHANGE_MODE:{ New_Mode(buf); + Move_Timer.reset(); break; } case RECEIVE_STATUS:{ @@ -519,19 +520,19 @@ } if(agz.nowMode == AUTO_GPS_MODE){ - if(Move_Timer.read_ms() < straight){ + if(agz.Move_Timer.read_ms() < straight){ agz.test_Auto(0); //straight } - if(Move_Timer.read_ms() > straight && Move_Timer.read_ms() < wait){ + if(agz.Move_Timer.read_ms() > straight && agz.Move_Timer.read_ms() < wait){ agz.test_Auto(1); } - if(Move_Timer.read_ms() > wait && Move_Timer.read_ms() < turning){ + if(agz.Move_Timer.read_ms() > wait && agz.Move_Timer.read_ms() < turning){ agz.test_Auto(2); //Turn Right } - if(Move_Timer.read_ms() > turning){ + if(agz.Move_Timer.read_ms() > turning){ agz.test_Auto(3); wait_ms(200); - Move_Timer.reset(); + agz.Move_Timer.reset(); } } }