You can setup servos to use PWM-ish through the GPIO pins using the RPIO Module which will send a PWM pulse which works great with servos.
Setting up the Hardware
To set up the Servos in a Pan and Tilt situation, Put a bottom servo as Pan and attach the second servo sideways as tilt and attach it to the Servo arm on the Pan servo. You can add linkages if you want more tilt per servo degree etc.
You can setup a python script like so ( You may need to apt-get install RPIO ).
from RPIO import PWM
servo = PWM.Servo()
Pin = 17
Exit = False
while not Exit:
In = raw_input("Enter Angle:")
servo.set_servo(Pin, int(In) * 10) # This will send a pulse
# of 10 times your angle e.g.
# In = 120, Out = 1200ms pulse
if len(In) < 1:
Exit = True # Exit if nothing entered.
# Cleanup servo Pin
which will loop through infinitely until you enter nothing. Each time setting the angle of one servo. Really simple to make 2 servos move. Just remember to Ground your Pins and to servo at least the recommended Voltage per servo.