Get started¶
Download and installation¶
Download a copy of the latest public release (current version: 1.1.0):
Unzip and run python setup.py build install
from the source
directory to install pyherkulex library on your machine.
Or simply copy-past pyherkulex folder in the working directory of your project.
Simple usage example¶
This simple example blinks LED in blue, in 1 second interval, of all HerkuleX servos connected to default serial port with default baudrate 115200.
#!/usr/bin/env python
"""
Blinks LED in blue of all connected HerkuleX servos.
"""
import pyherkulex as hx
import time
broadcast_srv = hx.Servo()
broadcast_srv.reboot()
while True:
broadcast_srv.led = hx.LED_BLUE
time.sleep(1)
broadcast_srv.led = hx.LED_OFF
time.sleep(1)
Tip
Before running this test, make sure each servos has its own ID, different from any other connected servo to avoid any communication error, or simply run this test with only one single servo connected to the serial bus.
Also make sure no servo has a specific baudrate value different than the default (factory) value 115200.
Finally, check servo status in case of LED blinking red (alarm).