Hi,
You have the servo on portB.4 but then you do
Code:
TRISB = $fe ' Enable first button row
Which sets that pin to input. So when you do:
Code:
servo1 = 1 ' Start servo pulse
Pauseus 1000 + pos ' Delay for servo pulse high time
servo1 = 0 ' End servo pulse
Pause 16 ' Servo update rate about 60Hz
Goto mainloop ' Do it all forever
PortB.4 won't go high since it's set to be an input.
Either change your servo1 = 1 to HIGH servo1 and servo1 = 0 to LOW servo1 or make sure that PortB.4 is setup as an output.
/Henrik Olsson.
Bookmarks