Friday, July 01, 2005

Switch makes LED blink



'Set the switch to portb.0 and set LED to portd.0
input portb.0
output portd.0
main:
if portb.0 = 1 then
' if the switch is closed on pin RB0
low portd.0
' set pin RD0 low
else
high portd.0
' set RD0 high
endif
goto main

0 Comments:

Post a Comment

<< Home