How to controll two servos with different angles at the same time?

I am currently working on a hexapod robot with 18 servo motors, what i want is to rotate servos with different angle simultaneously, i've tried to program it but i cant make it.. can you help me please? a simple program on how to make two servo motors run with different angle at the same time, thanks in advance!

"Same time" it is picky, one after other very quick for 2 motors is possible but I am not sure if having 18 servos changes the scenario. Maybe you can have a middle man, like 2 atmegas one per each 9 servos and a central arduino control everything via serial messages (I am guessing you need to do more things with the main arduino)

Here is one way to control 18 servos from one Arduino UNO -

http://rcarduino.blogspot.com/2012/08/arduino-serial-servos.html

I will release a new version with support for 20 servos using just four pins this weekend.

Duane B

rcarduino.blogspot.com

thazze21: I am currently working on a hexapod robot with 18 servo motors, what i want is to rotate servos with different angle simultaneously, i've tried to program it but i cant make it.. can you help me please? a simple program on how to make two servo motors run with different angle at the same time, thanks in advance!

The Arduino sketch program runs so fast that you can issue 18 different servo.write commands in a row to the 18 servos and they will all appear to start moving at the same time. It's all about the structure and program flow you use in your sketch that determines how the servos will activate. Servos are very slow compared to code execution speed. So perhaps you could post your sketch code and we can see if you are doing something wrong like using delay() statements or other beginner type mistakes.

Lefty

Thanks for the replies! i was able to run servo motors at the same time.. I just maneuver my program and had a short delay but it is not obvious, because the delay is too fast. it looks like they all run at the same time, thank you for you time :))) i appreciate it.