Hi everyone! I'm currently facing some issues with my project. I'm using an Arduino mega ADK which is connected to a RS 485 board for communication with my dynamixel RX64 motor. After successfully uploading the code below to the Arduino mega (when everything is powered), the motors do not move at all. Not too sure where the issue is as i've checked the connections between the components. Got the code from following this link:Arduino Dynamixel Library – Savage Electronics Blog
#include <DynamixelSerial.h>
void setup() {
Serial.begin(9600); // Initialize the serial communication
while(!Serial); // Wait until the serial port is ready
Dynamixel.setSerial(&Serial1); // &Serial - Arduino UNO/NANO/MICRO, &Serial1, &Serial2, &Serial3 - Arduino Mega
Dynamixel.begin(1000000,2); // Initialize the servo at 1 Mbps and Pin Control 2
delay(1000);
}
void loop() {
int position = random(200, 800);
int speed = random(200, 800);
Serial.print("Sending move command to servo 1, position: ");
Serial.println(position);
Dynamixel.move(1, position); // Move the Servo randomly from 200 to 800
delay(1000);
Serial.print("Sending moveSpeed command to servo 1, position: ");
Serial.print(position);
Serial.print(", speed: ");
Serial.println(speed);
Dynamixel.moveSpeed(1, position, speed);
delay(2000);
Serial.println("Sending setEndless command to servo 1");
Dynamixel.setEndless(1, ON);
delay(1000);
Serial.println("Sending turn command to servo 1, direction: RIGTH, speed: 1000");
Dynamixel.turn(1, RIGTH, 1000);
delay(3000);
Serial.println("Sending turn command to servo 1, direction: LEFT, speed: 1000");
Dynamixel.turn(1, LEFT, 1000);
delay(3000);
Serial.println("Sending setEndless command to servo 1");
Dynamixel.setEndless(1, OFF);
Serial.println("Sending ledStatus command to servo 1, status: ON");
Dynamixel.ledStatus(1, ON);
Serial.println("Sending moveRW command to servo 1, position: 512");
Dynamixel.moveRW(1, 512);
delay(1000);
Serial.println("Sending action command to servo 1");
Dynamixel.action();
Serial.println("Sending ledStatus command to servo 1, status: OFF");
Dynamixel.ledStatus(1, OFF);
delay(1000);
}



