mmmm.. let's assume that the "noise" will be less than 1 seconde
Code:
TRISB = 1
ServoInput VAR PORTB.0
rled VAR PORTB.1 ' BIND OUTPUT TO RB1
lled VAR PORTB.2
PORTB=0 ' turn leds off
PAUSE 1000 'boot delay
Start:
if ServoInput then ' same as If ServoInput=1 then
rled = 1 ' right side led on
pause 250 ' pause 1/4 second
rled = 0 ' right side led off
pause 250 'pause off
Else
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
endif
goto start
And the time you do the LED blink (500ms) can be enough to avoid some glitchs from servo motor.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks