Help understanding arduino mega outputs

I'm designing a robot which uses 18 servos and I'm having difficulty understanding how I can connect them to my arduino MEGA. On an article on the arduino.cc website, it states that: " The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega."
I've added up all the pwm outputs and analog outputs and they definitely do not add up to 48 pins. Can someone please tell me where I can find which other pins I can use the servo library on to control a servo motor?

The timing pulses for the Servos, 1-2mS wide occurring every 20mS are controlled by the timers.
The 2560 has more timers then the 328P has, thus is can control more Servo pins.
I believe the Servo pin assignments are independent of whether a pin supports PWM or not.
There are no Analog Outputs - only PWM outputs that you can filter to look like an analog level.

Assign your 18 servos to pins, try one at a time, and confirm the pin is working.
Servo's typically need 1 Amp of current each, make sure you have a large enough power supply if you plan on moving multiple servos at once.

The pins marked An are not analog outputs. They are pins that can be used as analog inputs via the analogRead() function.

Thank you for all your help

The pin your servo is connected to does not have to be a PWM pin, just an ordinary digital pin.

DanielMontazeri:
I'm designing a robot which uses 18 servos and I'm having difficulty understanding how I can connect them to my arduino MEGA. On an article on the arduino.cc website, it states that: " The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega."
I've added up all the pwm outputs and analog outputs and they definitely do not add up to 48 pins. Can someone please tell me where I can find which other pins I can use the servo library on to control a servo motor?

You can use any pins at all, including analog. Its not hardware driven, its interrupt driven.

You can even read the source code of the library to see how it works, as its all open-source.

MarkT:
You can use any pins at all, including analog. Its not hardware driven, its interrupt driven.

You can even read the source code of the library to see how it works, as its all open-source.

outsider:
The pin your servo is connected to does not have to be a PWM pin, just an ordinary digital pin.

Thank you guys, it really helped clear everything up