pulsout...servo...LEDs
While learning about pulsout useage, I added LEDs to parts of my simple servo control program. I got the servo moving just fine, but the LEDs never come on. Using an 84A and LEDs on B.4-B.6 and servo on B.0. Push buttons on A.0 and A.1. with pulldown resistors. This is where I am...
define osc 4
j var byte:speed var byte: portb=0:trisa=%00011
speed=50: porta.2=1' power to pic is on LED
main:
portb.6=1: portb.0=0' input loop LED on and clear servo pin
if (porta.0=1 and porta.1=1) then autosweep
if porta.0=1 then portb.4=1: pulsout portb.0,200: pause speed: portb.4=0:goto main
if porta.1=1 then portb.5=1: pulsout portb.0,70: pause speed: portb.5=0:goto main
portb.6=0:goto main
autosweep:
portb.4=1:for j=1 to 30: pulsout portb.0,200: pause speed:next j: portb.4=0
portb.5=1:for j=1 to 30: pulsout portb.0,70: pause speed:next j: portb.5=0
if porta.0=1 then main
if porta.1=1 then main
goto autosweep
end
None of the LEDs light while in the loops. Why? The servo works fine.
The more I think about it the worse off I am
Bookmarks