forward
Dependencies: VNH5019
Fork of AigamozuControlPackets by
Diff: AigamozuControlPackets.cpp
- Revision:
- 32:cd68a37d1ee1
- Parent:
- 31:8753fbab3f1f
- Child:
- 33:c11a9cb35840
diff -r 8753fbab3f1f -r cd68a37d1ee1 AigamozuControlPackets.cpp --- a/AigamozuControlPackets.cpp Sun May 17 11:38:02 2015 +0000 +++ b/AigamozuControlPackets.cpp Tue May 19 10:27:28 2015 +0000 @@ -188,6 +188,23 @@ else randomCount = 0; } + +void AigamozuControlPackets::test_Auto(int flag){ + + if(flag == 0){ + _agzSheild.changeSpeed(1, 64, 1, 64); //straight + } + if(flag == 1){ + _agzSheild.changeSpeed(0, 64, 0, 64); + } + if(flag == 2){ + _agzSheild.changeSpeed(1, 64, 2, 64); //Turn Right + } + if(flag == 3){ + _agzSheild.changeSpeed(0, 64, 0, 64); + } +} + bool AigamozuControlPackets::gpsAuto(){ /* @@ -214,12 +231,13 @@ Automove_Timer.reset(); out_count_flag = true; } - if(nowMode == AUTO_GPS_MODE){ - if(out_flag){ +/* if(nowMode == AUTO_GPS_MODE){ + + if(out_flag){ if(Automove_Timer.read_ms() < 5000){ _agzSheild.changeSpeed(2,64,2,64);//back }else if(Automove_Timer.read_ms() < 6000){ - _agzSheild.changeSpeed(1,64,2,64);//straight + _agzSheild.changeSpeed(1,64,1,64);//straight }else if(Automove_Timer.read_ms() >= 6000){ out_count_flag=false; out_flag=false; @@ -228,8 +246,8 @@ //if robot is inner _agzSheild.changeSpeed(1,64,1,64);//straight } - } - + } +*/ return out_flag; } @@ -336,11 +354,13 @@ //eachModeInt.attach(this,&AigamozuControlPackets::randomAuto,1.0); //eachModeInt.attach(this,&AigamozuControlPackets::gpsAuto,2.0); nowMode = AUTO_GPS_MODE; + //test_Auto(); break; case 3: //eachModeInt.attach(this,&AigamozuControlPackets::gpsAuto,0.2); nowMode = AUTO_GPS_MODE; + //test_Auto(); break; default: