HerkuleX-HelloWorld
This herkulex library is based on DongBu Robot documentation and protocol.
http://dasarobot.com/guide/herkulexeng.pdf
Diff: main.cpp
- Revision:
- 2:7004e3d0281f
- Parent:
- 1:ef646c52e08f
--- 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