As I do not have MX-64s, the following Arduino sketch was made for 2XL-430 with IDs set to 11 and 12 (see details in Dynamixel Palooza with OpenCM-9.04/C + 485-EXP (using MANAGER/TASK and ARDUINO) - #3 by roboteer - Community - ROBOTIS ).
Also, they are set up to use 1 Mbps via Dynamixel Wizard before running this code. Please adjust this code to suit your setup and run it. It should work OK. If not let me know.
#include <Dynamixel2Arduino.h>
#define DXL_SERIAL_3 Serial3 //Serial3 is for DXL Port going to 485-EXP Board
#define DEBUG_SERIAL Serial
const uint8_t DXL_DIR_PIN_3 = 22; //“22” is DIR_PIN for 485-EXP Board
Dynamixel2Arduino dxl_3(DXL_SERIAL_3, DXL_DIR_PIN_3);
//This namespace is required to use Control table item names
using namespace ControlTableItem;
void setup() {
// put your setup code here, to run once:
int8_t found_dynamixel = 0;
// Use UART port of DYNAMIXEL Shield to debug.
DEBUG_SERIAL.begin(115200); //set debugging port baudrate to 115200bps
while(!DEBUG_SERIAL); //Wait until the serial port is opened
dxl_3.begin(1000000); // need to match with DXLs baud rate used via Dynamixel Wizard
int8_t protocol = 2;
dxl_3.setPortProtocolVersion((float)protocol);
DEBUG_SERIAL.println("### SCANNING 485-EXP BOARD ");
DEBUG_SERIAL.print("SCAN PROTOCOL ");
DEBUG_SERIAL.println(protocol);
for(int id = 0; id < DXL_BROADCAST_ID; id++) {
//iterate until all ID in each baudrate is scanned.
if(dxl_3.ping(id)) {
DEBUG_SERIAL.print("ID : “);
DEBUG_SERIAL.print(id);
DEBUG_SERIAL.print(”, Model Number: ");
DEBUG_SERIAL.println(dxl_3.getModelNumber(id));
found_dynamixel++;
if (dxl_3.torqueOff(id))
DEBUG_SERIAL.println(“DYNAMIXEL Torque OFF”);
else
DEBUG_SERIAL.println(“Error: Torque OFF failed”);
if (dxl_3.setOperatingMode(id, (float) OP_POSITION)) // Position Control mode
DEBUG_SERIAL.println(“Position Control mode OK”);
else
DEBUG_SERIAL.println(“Error: Position Control mode failed”);
if (dxl_3.torqueOn(id))
DEBUG_SERIAL.println(“DYNAMIXEL Torque ON”);
else
DEBUG_SERIAL.println(“Error: Torque ON failed”);
}
}
DEBUG_SERIAL.print(“Total “);
DEBUG_SERIAL.print(found_dynamixel);
DEBUG_SERIAL.println(” DYNAMIXEL(s) found!”);
}
void loop() {
// put your main code here, to run repeatedly:
// Moving 2XL-430 on 485-EXP Board - ID=11 and 12
int8_t protocol = 2; // do all DXL with Protocol 2 next
dxl_3.setPortProtocolVersion((float)protocol);
dxl_3.setGoalPosition(12, 1024); // adjust DXL IDs as needed
dxl_3.setGoalPosition(11, 1024);
delay(1000);
dxl_3.setGoalPosition(12, 3072);
dxl_3.setGoalPosition(11, 3072);
}
If this sketch works OK, I’ll work on incorporating the RC-100 protocol next.