Multi servo control

Ok im currently attempting to create a pan tilt system based on an arduino, a used joystick and 2 servos. I have been unable to find any code to process 2 potentiometers and 2 servos at once. i adapted some of the single servo code but it never seems to work properly. The servos dont seem to get the proper input and are jittery also. Any help here is much appreciated! :-/

It depends on how you have adapted the code. look at this thread for and idea of how to do it:-
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1231884359

Or one of these if you prefer to let the hardware do the hard work:
http://www.arduino.cc/playground/ComponentLib/Servo
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1230479947

to save starting a new thread , i have a similar problem but i need all 6 pwn pins controlling servos but i have no idea how to get about 10 inputs and 6 outputs all looking for each other at the same time, ive been doing my homework and i understand the basics of the arduino language , but i cant see how to do more than one thing at once and what all the } are for. Im all used to the event driven stuff... ::slight_smile:

Its for a biped

Well, you'll have to learn to crawl before you can walk. :wink:

The important thing to remember is that a microcontroller can really only do one thing at a time. It can do things fast enough to appear to do them at the same time.

Really, though, the Servo lib takes care of all of that for you. The curly braces are there to group things together in C; you might want to get a "Learn C in 24 hours" books or something like it, just to get an introduction to the basic concepts.

Im all used to the event driven stuff.

Well just write event driven stuff in C if that is your paradigm. In the main loop pole the sensors for anything new happening. Then when it does just call that routine.

i need all 6 pwn pins controlling servos but i have no idea how to get about 10 inputs and 6 outputs all looking for each other at the same time

You don't use Arduino PWM pins for driving servos – analogWrite isn't the right way to drive servos. The good news is that you can use the servoTimer2 library to control your six servos in background (the library is the second link in post#2)
So your sketch can be monitoring the inputs and call methods in the library to set and maintain the servo positions. Each servo will seek and hold a given position until another command is given.

I hope that helps