Here is the "complete" code. This is a test area where I have all my equates and variable declarations for a bigger code, but I check little pieces at a time. The piece I'm checking now is the "snippet" I showed in previous post.
; Define LOADER_USED to allow use of the boot loader.
Define LOADER_USED 1
;Aliases use Var, symbols use = sign
;Code D,C,B, A in that order, from Snowflake to Arm to Light
;SNOWFLAKES
East Var PortD.0 ;Use Port D for Snowflakes and background
Cent var PortD.1 ;connect to enable line of 74373 latches
West var PortD.2
Back Var PortD.3 ;likely always set to "on" to keep background lit
;ARMS
Blu var PortC.0 ;Use Port C bottom nibble for arms
Org var PortC.1
Red var PortC.2
Grn Var PortC.3
Armson var PortC
Armsoff var PortC
;LIGHTS
LoLite var PortA
HiLite var PortB
L0 Var PortA.0
L1 var PortA.1 ;Low Lamps 0-7 Lo.0=first inside, using port A
L2 var PortA.2
L3 var PortA.3
L4 var PortA.4
L5 var PortA.5
L6 var PortA.6
L7 var PortA.7
H0 VAR PortB.0
H1 VAR PortB.1
H2 VAR PortB.2
H3 VAR PortB.3 ;High lamps 8-11 Hi.11=last outside, using port B
x var byte ;index variable for low lamps 0-7
y var byte ;index variable for high lamps 8-11
del var byte ;use var Word if value>255
d var byte
out var byte
;****************Program Start******************
Initialize:
TRISA= %00000000 ;set portA to all output
TRISB= %00000000 ;set PortB to all output
TRISC = %00000000 ;Set PORTC to all output
TRISD= %00000000 ;Set PortD to all output
Low Blu
Low Org
Low Red
Low Grn
LoLite=0
HiLite=0
low east ;initialize
low cent
low west
;high east
High Cent
;High West
;Armson=$0F ; all arms on, same as High Blu, High Red, etc
ArmsOff=$00; all arms off
d=0
Main: Gosub growspin
goto main
;*********************Subroutines***************** **********
growspin:For d = 0 To 7
Lookup d,[$1,$3,$7,$f,$1f,$3f,$7f,$ff],out
Lolite=out
pause 100 ;first 8 in about 2/sec for pause=100
Next d ;entire snowflake in about 1 sec
;For d = 0 To 3
;Lookup d,[$1,$3,$7,$f],out
;Hilite=out ;
;pause 100 ;
;Next d
;pause 500 ;hold all at end for 1/2 second
LoLite=0
Return
Bookmarks