I’m trying to control a Maestro 12 channel Servo Controller from an AuduinoBT.
I’m not sure I have the boards wired correctly.
I have the RX wried to the TX on each board.
I can control the servos with a PC.
I have the board set to a fixed baud of 9600 and I want to use the compact message format.
This is the function I am using.
void moveMotorToTarget(int motor, int target)
{
Serial.print("Move motor:");
Serial.print(motor,DEC);
Serial.print(" to target:");
Serial.println(target,DEC);
if (mySerial.available())
{
mySerial.print(0x84, BYTE); // motor command
mySerial.print((byte)motor, BYTE);
mySerial.print(target & 0x7F, BYTE);
mySerial.print((target >> 7) & 0x7F,BYTE);
}
else
{
Serial.println("serial not available");
}
}
The serial is available but as soon as I start sending commands to the Maestro Board the red error led turns on and if I think connect via USB I see a Server Protocol error.
Since you didn’t actually post the code that defined mySerial, I don’t know what kind of object it is, so this is only a guess. If this guess doesn’t solve your problem then please simplify your code to the simplest possible thing that demonstrates the problem and then post ALL of it, and use Code tags this time so it is more easily readable.
Pins 0 and 1 are hardware serial pins on the Arduino, so using them as software serial pins creates a conflict. What happens if you try using different pins for your software serial, such as 2 and 3, and connect these to your Maestro instead?