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.
Fork of AigamozuControlPackets by
AigamozuControlPackets.h
- Committer:
- m5171135
- Date:
- 2014-06-08
- Revision:
- 5:3f51eeb5aedc
- Parent:
- 4:04dadf67ecb6
- Child:
- 6:f164a716be46
File content as of revision 5:3f51eeb5aedc:
#include "mbed.h" #include "VNH5019.h" #ifndef AIGAMOZU_CONTROL_PACKETS #define AIGAMOZU_CONTROL_PACKETS #define MANUAL_COMMAND_LENGTH 17 #define REQUEST_COMMNAD_LENGTH 11 #define CHANGE_MODE_COMMAND_LENGTH 12 #define RECEIVE_STATUS_COMMNAD_LENGTH 32 enum COMMAND_TYPE {MANUAL = 'M', STATUS_REQUEST = 'S', CHANGE_MODE = 'C', RECEIVE_STATUS = 'R'}; enum MODE {STANDBY_MODE = 0, MANUAL_MODE = 1,AUTO_MODE = 2,AUTO_GPS_MODE = 3}; enum STATUS {GPS_AVAIL = 0, GPS_UNAVAIL = 1}; union TEST_T{ long a; uint8_t b[4]; }; class AigamozuControlPackets{ public: AigamozuControlPackets(VNH5019 agzSheild); Ticker hoge; uint8_t* packetData; //Create Packet: Controller/Base -> Robot void createManualCommad(uint8_t fromID,uint8_t toID,uint8_t directionL,uint8_t pwmL,uint8_t directionR, uint8_t pwmR); void createRequestCommand(uint8_t fromID,uint8_t toID,uint8_t); void createChangeModeCommand(uint8_t fromID,uint8_t toID,uint8_t,MODE mode); //Create Packet: Robot -> Controller/Base void createReceiveStatusCommand(uint8_t fromID,uint8_t toID,long latitudeH,long latitudeL,long longitudeH,long longitudeL); //uint8_t* createAckPacket(uint8_t fromID,uint8_t toID); //using create packet uint8_t* getPacketData(); int getPacketLength(); //Change Mode: bool changeMode(uint8_t *buf); //Check Command Type using xbee buffer; uint8_t checkCommnadType(uint8_t* buf); //Change Motor Speed void changeSpeed(uint8_t* buf); MODE nowMode; STATUS nowStatus; int packetLength; private: // VNH5019 _agzSheild; void manualMode(); int manualCount; //Auto Type 1 -> Random void randomAuto(); int randomCount; //Auto Type 2 -> GPS void gpsAuto(); }; #endif