Arduino/Servo Pan/Tilt: What pins?

I am new to electronics, not to mention micro-controllers. I & my son-in-law, have both bought Arduino boards. I have the Mega2560 & he bought the Make Ultimate Micro-Controller Pack with Netduino & Uno R3 (on sale at Micro-center for $14). I have found several servo libraries/sketches for controlling 2 servos, however, I can't find any actual schematics, eagle files, layout drawings, instructions on how to wire the motors to the Arduino! Can some one help??

bwrussell5 years ago
Careful wiring servos and motors directly to an Arduino. Get a motor/servo control board. You can find them pretty cheap online.

Here is pretty much everything you need:
http://arduino.cc/en/Tutorial/MotorKnob
Libahunt5 years ago
A sketch should have servo pins defined as variable or constant somewhere near the beginning or the pin number is directly put into [servoobject].attach([pin number]) statement in setup{}. You can change pins by replacing the number. For example the usual one sevo sweep code:
void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
} 
Instead of 9 there could be varaible name and then you should find the variable definition somewhere before that ".attach" line. For example:
int servoPin1 = 8;
...
void setup()
{
  ...
  servo1.attach(servoPin1);
  ...
} 

Wiring a servo is as simple as that: red wire - positive voltage, black (brown) wire - ground, third color - signal wire, to the arduino pin that is stated in the code.
You can check wire colors here: http://www.bpesolutions.com/gadgets.ws/gprojects/servowg.gif .

But if you are using two bigger or any more tha two servos, concider providing them voltage from another source than arduino 5V pin. The grounds must be connected together (GND pin on arduino to breadboard servo-ground for example).