Arduino + Pololu Mini Maestro 24 Channels

Hi,

I’ve been having trouble connecting my Arduino Mega 2560 with a Pololu Mini Maestro 24-Channel. I’ve been trying to do this by following this diagram (http://www.darrenfeetham.com/18ssc.html) and adapting some of the code to the newest Arduino version. The example I’m using is nearly at the bottom of the page. The problem is that no matter how I try to connect it the servos do not respond to the commands transmitted by the Arduino.

I’ve narrowed the problem to the misinterpretation of the control signals from the Pololu Mini Maestro. I’m manually constructing the signal according to the Compact Protocol for transmitting signals of the Pololu Mini Maestro, but still the servos do not move.

My code is:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(15, 14);
// ^^^---------------------//

void setup() // run once, when the sketch starts
{
mySerial.begin(9600);
delay(1000);
}
// Send a Set Target command to the Maestro.
// Target is in units of quarter microseconds
// so the normal range is 4000 to 8000.
void set_target(unsigned char servo, unsigned int target)
{
mySerial.write((byte)0xAA); //start byte
mySerial.write((byte)0x0C); //device id
mySerial.write((byte)0x04); //command number
mySerial.write((byte)servo); //servo number
mySerial.write((byte)target & 0x7F);
mySerial.write((byte)(target >> 7) & 0x7F);

}
// ^^^---------------------//

// LOOP--------------------// The base for the program
void loop()
{
analogWrite(14,200);
delay(1000);

delay(1000);
set_target(0, 8000);
delay(1000);
set_target(1, 4000);
delay(1000);
set_target(0, 6000);
delay(1000);
set_target(1, 6000);
delay(1000);
set_target(0, 4000);
delay(1000);
set_target(1, 8000);
}
// ^^^---------------------//

Have you tried hardware serial?

Have you checked serial output with any other serial device?