Maybe this can work better in case it is only code problem
Loop:
If IRLED1 =1 then
for a=1 to 100 'allow several pulses for the servo to reach the requested position
Pulsout 0,140 'could be 100=1ms to 200=2ms
pause 10
next a
else
pulsout 0,150 '150=1,5ms middle position
pause 10
endif
Goto Loop
Also check your servo if it is damaged since you power it with 9V instead of the usual 5V most RC servos work.
Bill




Bookmarks