AWOL:
I only obtain the data FFFFFF from the motor.
That suggest to me that you haven't fixed your code, and that you're reading -1 == "No serial data available" from your port.
Please post your code.
Hi AWOL,
I fixed the code already.
//___________________________________________________________________
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// Initial condition
//___________________________________________________________________
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
const int RTS = 4; //1= transmit, 0 =receive
byte ping =0x01;
byte READ =0x02;
byte WRITE =0x03;
byte REG =0x04;
byte ACTION=0x05;
byte RESET =0x06;
byte SYNC =0x83;
byte BEGIN =0xff;
int incomingByte = 0;
//___________________________________________________________________
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// Setup Function
//___________________________________________________________________
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void setup () {
pinMode(RTS, OUTPUT);
Serial.begin(57600);
Serial1.begin(57600);
}
// Main function
void loop()
{
byte notchecksum;
byte motor_ID=0x01;
byte length=0x02;
digitalWrite(RTS,HIGH);
delay (5);
notchecksum=~(motor_ID + length + ping);
Serial1.write(BEGIN);
Serial1.write(BEGIN);
Serial1.write(motor_ID);
Serial1.write(length);
Serial1.write(ping);
Serial1.write(notchecksum);
digitalWrite(RTS,LOW);
// send data only when you receive data:
while (Serial1.available() == 0)
{
incomingByte = Serial1.read();
}
incomingByte = Serial1.read();
Serial.print(Serial1.available(),HEX);
delay(1000);
}//This is program to send data to servo
Now, is the serial monitor does not give any display. I suspect that it keep stuck inside the WHILE loop.
Now, I am wondering if my Dynamixel motor does not send any data or, My 485 breakout circuit does not send me any data.
Do you have any idea?
Thanks