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 herkulex by
Revision 3:3aa495712025, committed 2013-01-14
- Comitter:
- passionvirus
- Date:
- Mon Jan 14 07:18:47 2013 +0000
- Parent:
- 2:971b320e1e8b
- Child:
- 4:e6873d42df32
- Commit message:
- add example code
Changed in this revision
| herkulex.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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:
