forward
Dependencies: VNH5019
Fork of AigamozuControlPackets by
Diff: AigamozuControlPackets.cpp
- Revision:
- 4:04dadf67ecb6
- Parent:
- 2:3f2d4f53ceed
- Child:
- 5:3f51eeb5aedc
diff -r 3f2d4f53ceed -r 04dadf67ecb6 AigamozuControlPackets.cpp --- a/AigamozuControlPackets.cpp Sun Jun 08 09:44:19 2014 +0000 +++ b/AigamozuControlPackets.cpp Sun Jun 08 11:54:53 2014 +0000 @@ -2,17 +2,16 @@ #include "VNH5019.h" -AigamozuControlPackets::AigamozuControlPackets(){ +AigamozuControlPackets::AigamozuControlPackets(Ticker autoInt){ packetData = new uint8_t[50]; packetLength = 0; } - - ////////////////////////////// // Controller/Base -> Robot // ////////////////////////////// + void AigamozuControlPackets::createManualCommad(uint8_t fromID,uint8_t toID,uint8_t directionL,uint8_t pwmL,uint8_t directionR, uint8_t pwmR) { uint8_t tmp[] = {'A','G','S','M','F',fromID,'T',toID,'L',directionL,pwmL,'R',directionR,pwmR,'A','G','E'}; @@ -57,6 +56,9 @@ ////////////////////////////// // Using createPacket // ////////////////////////////// +uint8_t AigamozuControlPackets::checkCommnadType(uint8_t* buf){ + return buf[14]; + } uint8_t* AigamozuControlPackets::getPacketData(){ return packetData; @@ -66,9 +68,7 @@ return packetLength; } -uint8_t AigamozuControlPackets::checkCommnadType(uint8_t* buf){ - return buf[14]; - } + bool AigamozuControlPackets::changeMode(uint8_t *buf){ @@ -85,6 +85,11 @@ case 2: nowMode = AUTO_MODE; break; + + case 3: + nowMode = AUTO_GPS_MODE; + break; + } return false; }