I'm trying to send serial data (bytes in an array) from my Arduino to a robot (lobot robotic arm) with no luck so far. I've tried sending data as a byte array, e.g.
'''
void loop() {
byte buf[payloadSz] = {0x55,0x55,0x08,0x03,0x01,0xE8,0x03,0x01,0xD0,0x07};
for (int i = 0; i < payloadSz; i++) {
Serial.write(buf*);*
_ Serial.print(buf*,HEX);_
_ }_
_}_
_'''*_ serial.write shows that it successfully sends the correct bytes, but the device I am sending it to response with a generic error. Not sure how to further debug. Some advice and insights would be much appreciated!
Could you please provide some more information about your issue? The better you prepare the question the more likely we will be able to help.
Which Arduino board are you using?
How is it connected to the robotoc arm?
Link to the data sheets of the robot arm.
Also some information about what you have already tested.
How does the device respond with a generic error?
Also often the error is in the code you are not showing. Best is, when you provide a minimal but complete example that shows the issue.