HerkuleX-HelloWorld
This herkulex library is based on DongBu Robot documentation and protocol.
http://dasarobot.com/guide/herkulexeng.pdf
main.cpp@0:50f3665aec00, 2013-01-14 (annotated)
- Committer:
- passionvirus
- Date:
- Mon Jan 14 07:50:04 2013 +0000
- Revision:
- 0:50f3665aec00
- Child:
- 1:ef646c52e08f
add HerkuleX HelloWorld
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
passionvirus | 0:50f3665aec00 | 1 | #include "mbed.h" |
passionvirus | 0:50f3665aec00 | 2 | #include "herkulex.h" |
passionvirus | 0:50f3665aec00 | 3 | |
passionvirus | 0:50f3665aec00 | 4 | Herkulex sv(p9, p10, 115200); |
passionvirus | 0:50f3665aec00 | 5 | DigitalOut led(LED1); |
passionvirus | 0:50f3665aec00 | 6 | |
passionvirus | 0:50f3665aec00 | 7 | int main() |
passionvirus | 0:50f3665aec00 | 8 | { |
passionvirus | 0:50f3665aec00 | 9 | wait(1); |
passionvirus | 0:50f3665aec00 | 10 | sv.setTorque(0xFD, TORQUE_ON); |
passionvirus | 0:50f3665aec00 | 11 | while(1) |
passionvirus | 0:50f3665aec00 | 12 | { |
passionvirus | 0:50f3665aec00 | 13 | led=1; |
passionvirus | 0:50f3665aec00 | 14 | sv.movePos(0xFD, 1002, 100, SET_MODE_POS, SET_LED_GREEN_ON); |
passionvirus | 0:50f3665aec00 | 15 | wait(3); |
passionvirus | 0:50f3665aec00 | 16 | |
passionvirus | 0:50f3665aec00 | 17 | led=0; |
passionvirus | 0:50f3665aec00 | 18 | sv.movePos(0xFD, 21, 100, SET_MODE_POS, SET_LED_BLUE_ON); |
passionvirus | 0:50f3665aec00 | 19 | wait(3); |
passionvirus | 0:50f3665aec00 | 20 | } |
passionvirus | 0:50f3665aec00 | 21 | } |