HerkuleX-HelloWorld
This herkulex library is based on DongBu Robot documentation and protocol.
http://dasarobot.com/guide/herkulexeng.pdf
Revision 2:7004e3d0281f, committed 2013-01-14
- Comitter:
- passionvirus
- Date:
- Mon Jan 14 21:04:59 2013 +0000
- Parent:
- 1:ef646c52e08f
- Commit message:
- new example code (rxPacket, getStatus, getPosition)
Changed in this revision
herkulex.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r ef646c52e08f -r 7004e3d0281f herkulex.lib --- a/herkulex.lib Mon Jan 14 16:25:33 2013 +0000 +++ b/herkulex.lib Mon Jan 14 21:04:59 2013 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/passionvirus/code/herkulex/#f737e5c70115 +http://mbed.org/users/passionvirus/code/herkulex/#1dacff31b77a
diff -r ef646c52e08f -r 7004e3d0281f main.cpp --- a/main.cpp Mon Jan 14 16:25:33 2013 +0000 +++ b/main.cpp Mon Jan 14 21:04:59 2013 +0000 @@ -7,28 +7,33 @@ int main() { sv.clear(0xFD); + sv.setTorque(0xFD, TORQUE_ON); + sv.getStatus(0xFD); + + sv.getPos(0xFD); + while(1) - { + { // POS Mode, +159.8 Degree, 100*11.2ms = 1120ms, Green LED On - sv.movePos(0xFD, 1002, 100, GLED_ON); + sv.positionControl(0xFD, 1002, 100, GLED_ON); wait(5); // POS Mode, -159.8 Degree, 100*11.2ms = 1120ms, Blue LED On - sv.movePos(0xFD, 21, 100, BLED_ON); + sv.positionControl(0xFD, 21, 100, BLED_ON); wait(5); // TURN Mode, CCW Turn, Green LED On - sv.turn(0xFD, 1023, GLED_ON); + sv.velocityControl(0xFD, 1023, GLED_ON); wait(5); // TURN Mode, CW Turn, Blue LED On - sv.turn(0xFD, -1023, BLED_ON); + sv.velocityControl(0xFD, -1023, BLED_ON); wait(5); // POS Mode, 0 Degree, 100*11.2ms = 1120ms, Red LED On - sv.movePos(0xFD, 512, 100, RLED_ON); + sv.positionControl(0xFD, 512, 100, RLED_ON); wait(5); // Clear error status