Debugged library and example main
Dependencies: MX106_not_working mbed-src AX12_final comunication_1
Fork of MX106-custom by
Diff: MX.h
- Revision:
- 11:19e8022f60ea
- Parent:
- 10:2acfa1a84c96
--- a/MX.h Sat Jul 02 18:06:59 2016 +0000 +++ b/MX.h Wed Jul 13 15:53:34 2016 +0000 @@ -61,13 +61,18 @@ MX(communication_1& line, int ID, float gear_train); virtual ~MX(); void setID(int newID); + int getID(); /** Set the mode of the servo * @param mode * 0 = Positional, default * 1 = Continuous rotation */ - void setMode(int mode); + virtual void setMode(int mode); + + void setCWLimitUnits(short limit); + void setCCWLimitUnits(short limit); + /** Set the clockwise limit of the servo * * @param degrees, 0-300 @@ -78,13 +83,15 @@ * @param degrees, 0-300 */ void setCCWLimit(float degrees); + /** Set the speed of the servo in continuous rotation mode * * @param speed, -1.0 to 1.0 * -1.0 = full speed counter clock wise * 1.0 = full speed clock wise */ - void setCRSpeed(float speed); + //void setCRSpeed(float speed); + // void setGoalPosition(float degrees); float getPosition(); @@ -97,13 +104,18 @@ * */ int setGoal(float degrees, int flags = 0); - void setSpeed(float goal_speed); + void setMaxSpeed(float degreeS); + void setCRSpeed(float degreeS); + void setSpeed(float degreeS); float getTemp(); float getCurrent(); float getVolts(); - float getPGain(); - float getIGain(); - float getDGain(); + virtual float getPGain(); + virtual float getIGain(); + virtual float getDGain(); + virtual void setPGain(float gain); + virtual void setIGain(float gain); + virtual void setDGain(float gain); void setMaxTorque(float torque); void setMotorEnabled(bool enabled); bool isMoving(); @@ -113,6 +125,9 @@ float _gear_train; int _ID; int _mode; + float maxSpeedDegreeS; + float limitCWDegrees; + float limitCCWDegrees;; }; #endif