LAB 2
DEFINE OSC 'Define the clock speed
input portb.0 'make RB0? an input
output portd.0 'assign output ports
OUTPUT portd.1
OUTPUT portd.2
OUTPUT portd.3
OUTPUT portc.3
OUTPUT portc.4
main:
if portb.0 = 1 then ' if the switch is closed on pin RB0?
GOTO yellows
else
GOTO greens
endif
goto main
yellows: 'yellows light up in a sequence
HIGH portc.3
PAuSe? 1000
low portc.3
high portd.0
pause 1000
low portd.0
high portd.1
pause 1000
low portd.1
HIGH portc.3
PAuSe? 1000
low portc.3
high portd.0
pause 1000
low portd.0
high portd.1
pause 1000
low portd.1
RETURN
greens: 'greens blink together
HIGH portc.4
HIgh? portd.3
high portd.2
pause 500
low portc.4
low portd.3
low portd.2
pause 500
HIGH portc.4
HIgh? portd.3
high portd.2
pause 500
low portc.4
low portd.3
low portd.2
RETURN
