herkulex servo control library (fixes velocityControl and positionControl)
Fork of herkulex by
Diff: herkulex.h
- Revision:
- 3:3aa495712025
- Parent:
- 2:971b320e1e8b
- Child:
- 4:e6873d42df32
diff -r 971b320e1e8b -r 3aa495712025 herkulex.h --- a/herkulex.h Mon Jan 14 07:12:46 2013 +0000 +++ b/herkulex.h Mon Jan 14 07:18:47 2013 +0000 @@ -193,9 +193,37 @@ #define SET_LED_BLUE_ON 0x08 #define SET_LED_RED_ON 0x10 - //------------------------------------------------------------------------------ - +/** herkulex Servo control class, based packet protocol on a serial + * + * Example: + * @code + * + *#include "mbed.h" + *#include "herkulex.h" + * + *Herkulex sv(p9, p10, 115200); + *DigitalOut led(LED1); + * + *int main() + *{ + * wait(1); + * sv.setTorque(0xFD, TORQUE_ON); + * while(1) + * { + * led=1; + * sv.movePos(0xFD, 1002, 100, SET_MODE_POS, SET_LED_GREEN_ON); + * wait(3); + * + * led=0; + * sv.movePos(0xFD, 21, 100, SET_MODE_POS, SET_LED_BLUE_ON); + * wait(3); + * } + *} + * + * @endcode + */ +//------------------------------------------------------------------------------ class Herkulex { public: