That looks like a compiler error, right? That would mean that the problem isn’t so much that the Arduino isn’t sending out the correct commands, but that your code isn’t compiling correctly, and the Arduino environment isn’t producing anything to download to the Arduino board.
It looks like your blending code from a few different sources there. I recognize the put command from my serial servo control example program, with the print statement on the last line changed into an Arduino serial print statement. I wrote that example program in C, but its meant to compile and run on a 32 bit Windows computer (not a microcontroller) to control a Pololu serial servo controller directly from a computer serial port.
Not to worry, but I think we need a couple more clarifying questions:
-Which Arduino board are you using?
-Is there a reason you would want to execute the serial protocol in software (which your current code is trying to do), rather than using the hardware serial module built into the Arduino?
There’s a tutorial on using the Arduino serial hardware here. Sending commands to the servo controller on Arduino Pin 1 is just like printing the text “Hello World” back to the Arduino environment running on your computer. Well, except your servo controller won’t do anything if you say “Hello World” to it. But functionally they’re the same thing, we can get into the language of the Pololu serial communication protocol later.
And just for fun, what are your plans for the four servos once you have them up and running?
There are some built in functions in the Arduino environment you can use to control up to 20 servos directly (i.e. without using the serial servo controller). If you’re interested in doing that, you might want to take a look at this tutorial.
Personally, I prefer the external servo controller approach, since it takes care of the entire servo protocol for you (you have to keep calling the Arduino functions to keep the servos where you want them), and the Pololu servo controllers have some nice features that the Arduino servo functions do not (smooth speed control is my favorite). Plus you already have one!
Also, if you just need to control servos with your computer, you could bypass the Arduino all together and connect the servo controller to a serial port on your computer (carefully, the serial connection from your computer has to be made to a different input pin than the one from the Arduino board, or you could destroy the servo controller!) That’s what my example C program is designed to do. If you’re new to programming though, and/or you’ll want to control the servos from the Arduino without a computer hooked up later, the Arduino board is a much better starting platform/interface.
-Adam