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: Communication_Robot
Fork of BEAR_Protocol by
BEAR_Protocol.h@5:6f30b4ea4020, 2016-01-15 (annotated)
- Committer:
- b0ssiz
- Date:
- Fri Jan 15 17:02:08 2016 +0000
- Revision:
- 5:6f30b4ea4020
- Parent:
- 4:9fbe67ca2f1b
- Child:
- 8:e1f43b1df0b5
Add function set Kp,Ki and Kd for upper and lower joint
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| b0ssiz | 0:fc963e08d580 | 1 | #include "mbed.h" |
| b0ssiz | 0:fc963e08d580 | 2 | #include "Command.h" |
| b0ssiz | 0:fc963e08d580 | 3 | #include "communication.h" |
| b0ssiz | 0:fc963e08d580 | 4 | |
| b0ssiz | 0:fc963e08d580 | 5 | #define SERIAL_DEBUG |
| b0ssiz | 0:fc963e08d580 | 6 | #define RS485_DELAY 90 |
| b0ssiz | 0:fc963e08d580 | 7 | #define RS485_DIRC PA_14 |
| b0ssiz | 0:fc963e08d580 | 8 | |
| b0ssiz | 0:fc963e08d580 | 9 | |
| b0ssiz | 0:fc963e08d580 | 10 | |
| b0ssiz | 0:fc963e08d580 | 11 | class Bear_Communicate |
| b0ssiz | 0:fc963e08d580 | 12 | { |
| b0ssiz | 0:fc963e08d580 | 13 | private: |
| b0ssiz | 0:fc963e08d580 | 14 | COMMUNICATION *com; |
| b0ssiz | 0:fc963e08d580 | 15 | |
| b0ssiz | 0:fc963e08d580 | 16 | public: |
| b0ssiz | 0:fc963e08d580 | 17 | Bear_Communicate(PinName,PinName,int); |
| b0ssiz | 4:9fbe67ca2f1b | 18 | void FloatSep(float,uint8_t*,uint8_t*); |
| b0ssiz | 0:fc963e08d580 | 19 | // Set Command |
| b0ssiz | 4:9fbe67ca2f1b | 20 | uint8_t setID(uint8_t,uint8_t); |
| b0ssiz | 4:9fbe67ca2f1b | 21 | uint8_t setMotorPos(uint8_t,float,float); |
| b0ssiz | 5:6f30b4ea4020 | 22 | uint8_t setUpMotorKp(uint8_t,float); |
| b0ssiz | 5:6f30b4ea4020 | 23 | uint8_t setLowMotorKp(uint8_t,float); |
| b0ssiz | 5:6f30b4ea4020 | 24 | uint8_t setUpMotorKi(uint8_t,float); |
| b0ssiz | 5:6f30b4ea4020 | 25 | uint8_t setLowMotorKi(uint8_t,float); |
| b0ssiz | 5:6f30b4ea4020 | 26 | uint8_t setUpMotorKd(uint8_t,float); |
| b0ssiz | 5:6f30b4ea4020 | 27 | uint8_t setLowMotorKd(uint8_t,float); |
| b0ssiz | 0:fc963e08d580 | 28 | //EEPROM |
| b0ssiz | 4:9fbe67ca2f1b | 29 | uint8_t setMargin(uint8_t,float); |
| b0ssiz | 4:9fbe67ca2f1b | 30 | uint8_t setHeight(uint8_t,float); |
| b0ssiz | 4:9fbe67ca2f1b | 31 | uint8_t setWheelPos(uint8_t,float); |
| b0ssiz | 4:9fbe67ca2f1b | 32 | uint8_t setMagData(uint8_t,float,float,float,float,float,float); |
| b0ssiz | 4:9fbe67ca2f1b | 33 | uint8_t setOffset(uint8_t,float,float); |
| b0ssiz | 4:9fbe67ca2f1b | 34 | uint8_t setBodyLength(uint8_t,float); |
| b0ssiz | 4:9fbe67ca2f1b | 35 | uint8_t setAngleRange(uint8_t,float,float); |
| b0ssiz | 4:9fbe67ca2f1b | 36 | |
| b0ssiz | 4:9fbe67ca2f1b | 37 | // get Command |
| b0ssiz | 4:9fbe67ca2f1b | 38 | uint8_t getMotorPos(uint8_t,float*,float*); |
| b0ssiz | 5:6f30b4ea4020 | 39 | uint8_t getUpMotorKpKiKd(uint8_t,float*,float*,float*); |
| b0ssiz | 5:6f30b4ea4020 | 40 | uint8_t getLowMotorKpKiKd(uint8_t,float*,float*,float*); |
| b0ssiz | 0:fc963e08d580 | 41 | //EEPROM |
| b0ssiz | 4:9fbe67ca2f1b | 42 | uint8_t getMargin(uint8_t,float*); |
| b0ssiz | 4:9fbe67ca2f1b | 43 | uint8_t getHeight(uint8_t,float*); |
| b0ssiz | 4:9fbe67ca2f1b | 44 | uint8_t getWheelPos(uint8_t,float*); |
| b0ssiz | 4:9fbe67ca2f1b | 45 | uint8_t getMagData(uint8_t,float*,float*,float*,float*,float*,float*); |
| b0ssiz | 4:9fbe67ca2f1b | 46 | uint8_t getOffset(uint8_t,float*,float*); |
| b0ssiz | 4:9fbe67ca2f1b | 47 | uint8_t getBodyLength(uint8_t,float*); |
| b0ssiz | 4:9fbe67ca2f1b | 48 | uint8_t getAngleRange(uint8_t,float*,float*); |
| b0ssiz | 0:fc963e08d580 | 49 | }; |
