mbedos senza corrente
Diff: MX.h
- Revision:
- 22:5d3f37356915
- Parent:
- 21:fe5dd48bebc6
--- a/MX.h Tue Nov 05 08:57:38 2019 +0000 +++ b/MX.h Tue Nov 05 14:26:34 2019 +0000 @@ -42,16 +42,16 @@ //#define OPERATING_MODE_DEBUG 1 //#define SETBAUD_DEBUG 1 -//#define SYNC_TORQUE_ENABLE_DEBUG 1 -//#define SYNC_SETGOAL_DEBUG 1 +#define SYNC_TORQUE_ENABLE_DEBUG 0 +#define SYNC_SETGOAL_DEBUG 0 #define SYNC_GET_POSITION_DEBUG 0 -//#define SYNC_SENDPACKET_DEBUG 1 -//#define SYNC_SENDPACKET_DEBUG_PACKETONLY 1 -//#define SYNC_READPACKET_DEBUG_PACKETONLY 0 -//#define SYNC_SET_BAUD_DEBUG 1 -//#define SYNC_GET_CURRENT_DEBUG 0 -//#define SYNC_GOAL_CURRENT_DEBUG 1 -//#define SYNC_OPERATING_MODE_DEBUG 1 +#define SYNC_SENDPACKET_DEBUG 0 +#define SYNC_SENDPACKET_DEBUG_PACKETONLY 0 +#define SYNC_READPACKET_DEBUG_PACKETONLY 0 +#define SYNC_SET_BAUD_DEBUG 0 +#define SYNC_GET_CURRENT_DEBUG 0 +#define SYNC_GOAL_CURRENT_DEBUG 0 +#define SYNC_OPERATING_MODE_DEBUG 0 // Protocol 2.0 // N.B. all Register values are in HEX, on the on-line manual all are in DEC @@ -71,6 +71,8 @@ #define MX_REG_GOAL_CURRENT 0x66 #define MX_REG_CURRENT_LIMIT 0x26 #define MX_REG_GOAL_PWM 0x64 +#define MX_REG_PROFILE_ACCELER 0x6C +#define MX_REG_PROFILE_VELOCITY 0x70 #define MX_OFF 0 #define MX_ON 1 @@ -214,9 +216,11 @@ int SyncGoalCurrent(float mAmpere[]); int SyncCurrentLimit(float mAmpere, int ID); int SyncCurrentLimit(float mAmpere[]); - int SyncOperatingMode(int mode[], int ID); - int SyncSetBaud(int MotorBaud[], int ID); - int SyncGoalPWM(float values[], int ID); + int SyncOperatingMode(int mode[], int ID =-1); + int SyncSetBaud(int MotorBaud[], int ID =-1 ); + int SyncGoalPWM(float values[], int ID =-1 ); + int SyncProfileAccel(float profileValAcc[]); + int SyncProfileVel(float profileValueVel[]); private :