I will do my best to explain what I am doing, but if I miss something please let me know.
I am using:
Arduino Mega
RS485 Shield.
ROBOTIS Dynamixel 'X' Series ( XM430-W210-R) Smart servos.
The library I am using does not support the 'Acceleration' feature I want to use.
I was able to generate this line of hex that worked,
byte M7[] = {0xff, 0xff, 0xfd, 0x00, 0x03, 0x09, 0x00, 0x03, 0x70, 0x00, 0xaa, 0x00, 0x00, 0x00, 0xff, 0x21};
Serial.write(M7, sizeof(M7));
FF,FF,FD,00 : this is the header with a reserved bit of '0'
03 : This is the address of the Dynamixel In this case ID#:3
09, 00 : This is how many remaing bytes to expect. not including these 2.
03 : This is the command to write data to the servo.
70 : This is the hex value of '112' Or the position in the control table of the servo, in this case it is Velocity.
http://support.robotis.com/en/product/actuator/dynamixel_x/xm_series/xm430-w350.htm
00 : blank
AA : This is the hex value of '170' the Acceleration I want.
00, 00, 00 : Blank space.
FF, 21 : This is the CRC Checksum.
I am using protocol 2.0
http://emanual.robotis.com/docs/en/dxl/protocol2/
Now with all of that said,
I want to generate the same above command, but instead of ID#3, I want to use the broadcast ID of 254 (0xFE).
The problem I am running into is the checksum (CRC) calculation,
They supply this example code,
http://emanual.robotis.com/docs/en/dxl/crc/
Lets just say I am a bit confused on the implementation.
I am asking for pointers on how best to go about this calculation?
I only ever need to generate this once. so not sure if it is worth create the code to do so.
Thanks!