Tuesday, July 05, 2005

Switch Var, during Switch ON, LED lights


'Set Switch to portb.0 and set LED to portb.7
'During the switch on, LED lights.
switchVar var byte
'Switch as INPUT
input portb.0
'LED as OUTPUT
output portb.7
pause 500
' start program with half-second delay
main:
'this code means portb.7, LED = the state of the switch (condition)
switchVar = portb.0
portb.7 = switchVar
goto main

0 Comments:

Post a Comment

<< Home