I change some things in your code
Code:
trisb.0=1 ' sets input for servo signal
ServoInput VAR PORTB.0
trisb.1 = 0 ' Set RB1 as output
rled VAR PORTB.1 ' BIND OUTPUT TO RB1
trisb.2 = 0 ' set RB2 as output
lled VAR PORTB.2
' PS : we can also define TRIS in one shot
' TRISB = 1
' in the above, only B0 is an input
Start:
rled = 0 ' right leds off
lled = 0 ' left leds off
Select Case ServoInput
Case 1
rled = 1 ' right side led on
pause 250 ' pause 1/4 second
rled = 0 ' right side led off
pause 250 'pause off
Case 0
lled = 1 'left side led on
pause 250 'pause 1/4 sec
lled = 0 ' left led off
pause 250 'pauses off for 1/4 sec
end select
goto start
Last edited by mister_e; - 4th February 2005 at 20:32.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks