DEFINE OSC 8
INCLUDE "MODEDEFS.BAS"
a1 var word : b0 var byte : trisa=3 : trisb=0 : low portb : pause 500
Start: IF PORTA.0 = 1 THEN START
PAUSEUS 100 : IF PORTA.0 = 1 THEN START
PAUSEUS 1350 : A1.0[13] = PORTA.0
for b0 = 12 to 0 step -1 : a1.0[b0]=porta.0 : pauseus 1700 : next b0
if a1.lowbyte = $FF THEN START
A1 = ~A1 & $003F
IF PORTA.1 = 1 THEN
if a1 > 0 and a1 < 9 then
toggle portb.0[a1-8] : pause 500 : goto start
else
if a1=9 then
toggle porta.2 : pause 500 : goto start
else
if a1=10 then
toggle porta.3 : pause 500 : goto start
else
if a1=11 then
portb=$ff : porta.2=1 : porta.3=1 : pause 500 : goto start
else
if a1=12 then
portb=0 : porta.2=0 : porta.3=0 : pause 500 : goto start
endif
endif
endif
endif
endif
ELSE
if a1>0 and a1<9 then
high portb.0[a1-8] : pause 500 : low portb.0[a1-8]:goto start
else
if a1=9 then
high porta.2 : pause 500 : low porta.2 : goto start
else
if a1=10 then
high porta.3 : pause 500 : low porta.3 : goto start
else
if a1=11 then
portb=$ff : porta.2=1 : porta.3=1 : pause 500 : portb.=0 : porta.2=0 : porta.3=0 : goto start
endif
endif
endif
endif
ENDIF
PAUSE 250 : GOTO START
END
Bookmarks