Hard to say without reading the docs in detail, but I wonder where the motorid is set. It seems to be the address of the servo, so that you can use multiples on a single bus. Do you have to use the vendor's software to find out/set the motorid for your particular servo?
The herkulex has the communication speed set to 115200 baud. Did you change the baud to 57600? Otherwise it doesn't work.
The ID out of the box is 0xFD, corresponding to 253. It's correct.
#include <Herkulex.h>
int n=219; //motor ID
void setup()
{
delay(2000);
Serial.begin(115200);
Herkulex.beginSerial1(115200);
Herkulex.reboot(254);
delay(5000);
Herkulex.clearError(n);
Herkulex.ACK(1);
Herkulex.setLed(n,3);
Serial.println(Herkulex.stat(n));
Herkulex.torqueON(n);
delay(1000);
}
void loop(){
}
I am using an arduino mega 2560 and Herkulex DRS 0402. Using library from this site: http://robottini.altervista.org/dongbu-herkulex-arduino-library-2
and the above code I cannot run the servo. The output of Herkulex.stat is 255 and while it gets to torqueON command it starts red blinking. Help me please, I am really confused, I stuck in this point more than one week!