Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: VNH5019
Dependents: Aigamozu_Robot_展示会 Aigamozu_Robot_March Aigamozu_Robot_templete
Fork of AigamozuControlPackets by
Diff: AigamozuControlPackets.cpp
- Revision:
- 42:04ca5242eaf2
- Parent:
- 41:fbf8f617a6ab
- Child:
- 43:e011cf13dbb2
- Child:
- 44:da580a931f28
--- a/AigamozuControlPackets.cpp Mon Oct 24 08:14:05 2016 +0000
+++ b/AigamozuControlPackets.cpp Mon Oct 24 09:12:37 2016 +0000
@@ -1,9 +1,9 @@
#include "AigamozuControlPackets.h"
#include "VNH5019.h"
-#define RIGHT_SPEED 16
-#define LEFT_SPEED 54
-#define FORWARD_SPEED 64
+#define RIGHT_SPEED 0
+#define LEFT_SPEED 32
+#define FORWARD_SPEED 32
//////////////////////////////
// Init //
@@ -53,11 +53,23 @@
if(nowMode == AUTO_GPS_MODE){
- if(Move_Timer.read_ms() < 6000){
- _agzSheild.changeSpeed(1,LEFT_SPEED,1,RIGHT_SPEED);//straight
- }else if(Move_Timer.read_ms() >= 6000){
- _agzSheild.changeSpeed(0,LEFT_SPEED,0,RIGHT_SPEED);
- Move_Timer.reset();
+ if(Move_Timer.read_ms() < 4000){
+ _agzSheild.changeSpeed(1,LEFT_SPEED,1,RIGHT_SPEED);//turn
+ }else if(Move_Timer.read_ms() >= 4000 && Move_Timer.read_ms() < 5000){
+ _agzSheild.changeSpeed(0,0,0,0);//stop
+ }else if(Move_Timer.read_ms() >= 5000 && Move_Timer.read_ms() < 6000){
+ _agzSheild.changeSpeed(1,FORWARD_SPEED,1,FORWARD_SPEED);//forward
+ }else if(Move_Timer.read_ms() >= 6000 && Move_Timer.read_ms() < 7000){
+ _agzSheild.changeSpeed(0,0,0,0);//stop
+ }else if(Move_Timer.read_ms() >= 7000 && Move_Timer.read_ms() < 12000){
+ _agzSheild.changeSpeed(1,RIGHT_SPEED,1,LEFT_SPEED);//turn
+ }else if(Move_Timer.read_ms() >=12000 && Move_Timer.read_ms() < 13000){
+ _agzSheild.changeSpeed(0,0,0,0);//stop
+ }else if(Move_Timer.read_ms() >= 13000 && Move_Timer.read_ms() < 14000){
+ _agzSheild.changeSpeed(1,FORWARD_SPEED,1,FORWARD_SPEED);//forward
+ }else if(Move_Timer.read_ms() >= 14000 && Move_Timer.read_ms() < 15000){
+ _agzSheild.changeSpeed(0,0,0,0);//stop
+ Move_Timer.reset();
}
}
