TQ for the reply. actually i wrote this program for servo turn from 0 degree-90 degree. and the from 90 degree to 0 back. so the servo is only have to turn like that. so i'm not to modified the servo instead using standard servo.

for the instruction :
val=0
For val=0 TO 80
PulsOut PORTB.3,150 ' - servo rotate from 0 degree-90 degree

the problem came on this:
IF IRSwitch =1 Then
Pause 1000
GoSub CloseGate 'when the sensor =1 (this part is not working)
EndIF
GoSub Main


For val=0 TO 80
PulsOut PORTB.3,50 'servo rotation - servo rotate from 90 degree-0 degree:

this instruction is working with servo is rotate but the problem is i need to send the data to make the servo run.

actually, the things that i want is to the sensor =1 and no serial input to make the servo turn.

tq for help me..