hello
i have a problem on moving the dynamixel XC430-w240-t servo so i think it would be better if i put the code of the function i have coded for movement in wheel mode and if i have had any mistake may you please inform me regarding my mistake
the following code is written in arduino (C++)
void velocity(unsigned char id, char ccw_cw, int speed) {
unsigned char packet[15];
if (ccw_cw == 1) // cw
{
bitWrite(speed, 10, 1); // set bit_10
} else // ccw
{
bitWrite(speed, 10, 0); // clear bit_10
}
packet[0] = 0xff;
packet[1] = 0xff;
packet[2] = id;
packet[3] = (2 + 3); // Length
packet[4] = 3;
////////////////
packet[5] = 104; // speed address
packet[6] = lowByte(speed);
packet[7] = highByte(speed);
////////////////
// checksum
packet[8] = ~(packet[2] + packet[3] + packet[4] + packet[5] + packet[6] + packet[7]);
for (int i = 0; i <= 8; i++) {
Serial.write(packet[i]);
}
}
i can control all the functions except the ones with highBytes and lowBytes such as velocity mode movement, joint mode movement, and angle limits
i would be thankful for your reply