thanks for the reply i have just seen my mistake thanks really it shound look like this then?

'servo control prog

'set variables

ch1 var byte
ch2 var byte

s1 = 150

start:

pulsin portb,1,Ch1
pulsin portb,2,Ch2

if ch1 < s1 then output1
if ch1 > s1 then output1
if ch1 = s1 then output2


output1:

pulsout portb.3,ch1
pause 18
goto start

output2:

pulsout portb.3,ch2
pause 18
goto start

end


Secound question how do i subsitue ch2 for a pot instead of a pwm signal would it look like this

potportb.2,200,var

would this give me the correct value to output to a servo?