You can prove your servos with potentiometers, it shows in the lcd the current position of the servomotor.

Code in PBP for Pic micro:
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 5
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 4
Define ADC_BITS 8
Define ADC_CLOCK 3
Define ADC_SAMPLEUS 50
adval var byte
b0 var byte
b1 var byte
b2 var byte
b6 var byte
b7 var word
mover var word
TRISA = %11111111
ADCON1 = %00000010
pause 250
lcdout $FE,1,"SRV1 SRV2 SRV3"
start:
lcdout $FE,$C0,dec3 b0," ",dec3 b1," ",dec3 b2
PORTC = 0
pulsout PORTC.0, b0
pulsout PORTC.1, b1
pulsout PORTC.2, b2
b7 = b0 + b1 + b2
b6 = b7/100
b7 = 15 - b6
pause b7
Adcin 0, b0
Adcin 1, b1
Adcin 2, b2
goto start
end
I think it is useful to study the positions of the servos to make a simple robot.
I hope that simple example will be useful.
Enjoy
