Apparently the github version of the IDE as two sketches just for this occasion ("File->Examples->06. Dynamixel" named "d_Dxl_ID_Change" and "e_Dxl_Bps_Change"). Basically, upload this sketch to the CM-904 and connect one servo, let the sketch run until the servo starts panning back and forth. After it is moving, you disconnect everything, change the desired ID number in the sketch and re-upload to the CM-904, and repeat the process for the next servo.
YOU MUST CONNECT ONLY ONE SERVO AT A TIME TO THE CM-904. IT USES THE BROADCAST ID, SO ALL SERVOS ON THE BUS WILL CHANGE THEIR BAUDRATE AND ID TO THE SAME VALUE.
Code:
Dynamixel Dxl(1); //Dynamixel on Serial1(USART1)
void setup() {
// Initialize the dynamixel bus:
Dxl.begin(34); //57600bps
Dxl.writeByte(0xfe, P_ID, 1); //Change dynamixel ID #1 (argument #3 is desired ID number)
Dxl.writeByte(0xfe, P_BAUD_RATE, 1); // Set baudrate to 1 Mbps
// Re-initialize dynamixel bus at 1Mbps
Dxl.begin(1); // initialize again at new baudrate 1Mbps
}
void loop() {
delay(500); // Wait for 0.5 second (500 milliseconds)
Dxl.writeWord(1, P_GOAL_POSITION_L, 512); // Rotate dynamixel ID 1 to position ~45 degrees
delay(500); // Wait for 0.5 second
Dxl.writeWord(1, P_GOAL_POSITION_L, 3584);// Rotate dynamixel ID 1 to position ~315 degrees
}
Bookmarks