Different way of doing your code (may have messed some of it up along the way)
Also, not sure about the '887 and it's watchdog timer, so added a chunk to your DEVICE statement to turn it off.
Your code wasn't badly written, just a bit lengthy and could have stood to be shortened up a bit, things combined here and there...
Code:
'***********CHRISTMAS STAR PROGRAM FOR OPERATING *************
'**********A 16 ARM STAR WITH 8 LEDS ON EACH ARM *************
'******ARMS CONNECTED TO PORTS A AND C AND EACH "RING" ******
'***************CONNECTED TO A PIN OF PORT D ******************
'************AUTHOR DAVID MARKS DEC 2008 ***********************8
@ DEVICE pic16f887,intrc_osc_noclkout,wdt_off
ansel=0 : delay var word : fastflash var word : temp var byte
fastflash = 150
PORTD=0 : PORTA=0 : PORTC=0 : TRISD=0 : TRISA=0 : TRISC=0
ring var portd : arma var portc : armb var porta
loop:
'********************************************
'EXPANDING WHITE CIRCLES
'********************************************
For delay = 400 to 0 step -25
arma = $55 : armb = $55 : gosub ringer
next delay
arma = 0 : armb = 0
'**************************************************
'EXPANDING RED CIRCLES
'**************************************************
For delay = 400 to 0 step -25
arma = $aa : armb = $aa : gosub ringer
next delay
'************************************************
'EXPANDING MULTICOLOUR CIRCLES
'************************************************
For delay = 400 to 0 step -25
arma = $ff : armb = $ff : gosub ringer
next delay
'*****************************************************
'EXPANDING WHITE DISC
'*****************************************************
arma=0 : armb=0
For delay = 400 to 0 step -25
arma = $55 : armb = $55 : gosub ringer : ring = 0
next delay
'******************************************************
'flash all white
'******************************************************
fOR DELAY = 0 TO 100
ring = $ff : pause fastflash : ring = 0 : pause fastflash
next delay
'******************************************************
'EXPANDING RED DISC
'******************************************************
arma=0 : armb=0
For delay = 400 to 0 step -25
arma = $aa : armb = $aa : gosub ringer : ring = 0
NEXT DELAY
'*********************************************
'FLASH ALL RED
'*********************************************
fOR DELAY = 0 TO 100
ring = $ff : pause fastflash : ring = 0 : pause fastflash
next delay
'*********************************************
'EXPANDING MULTICOLOUR DISC
'*********************************************
arma=$ff : armb=$ff
For delay = 400 to 0 step -25
gosub ringer : ring = 0
next delay
'*******************************************************************
'flashall
'*******************************************************************
arma=$ff : armb=$ff
For delay = 400 to 0 step -25
ring = $ff : pause delay : ring = 0 : Pause delay
next delay
For delay = 0 to 100
ring = $ff : pause fastflash : ring = 0
next delay
'****************************************
'ROTATE WHITE
'****************************************
ring = $ff
for delay = 400 to 50 step -30
for temp = 0 to 7 step 2
arma.0[temp] = 1 : armb.0[temp] = 1
pause delay
arma.0[temp] = 0 : armb.0[temp] = 0
next temp
next delay
'*********************************************
'ROTATE MULTI
'*********************************************
ring = $ff
for delay = 300 to 50 step -10
arma = $83 : armb = $83 : pause delay : arma = 0 : armb = 0
pause delay : arma = $06 : armb = $06 : pause delay : arma = 0
armb = 0 : arma = $30 : armb = $30 : pause delay : arma = 0
armb = 0 : arma = $c0 : armb = $c0 : pause delay : arma = 0 : armb = 0
armb = 0
next delay
goto loop
ringer: for temp = 0 to 7 : ring.0[temp] = 1 : pause delay : ring.0[temp] = 0
pause delay : next temp : return
How about that?
And for all those that have missed it...
Here's some colons I had to get off my chest
Code:
@ DEVICE pic16f887,intrc_osc_noclkout,wdt_off
ansel=0:delay var word:fastflash var word:temp var byte:fastflash=150:PORTD=0
porta=0:portc=0:trisd=0:trisa=0:trisc=0:ring var portd:arma var portc
armb var porta:armb var porta
loop: for delay=400 to 0 step -25:arma=$55:armb=$55:gosub ringer:next delay
arma=0:armb=0:for delay=400 to 0 step -25:arma=$aa:armb=$aa:gosub ringer
next delay:for delay=400 to 0 step -25:arma=$ff:armb=$ff:gosub ringer
next delay:arma=0:armb=0:For delay=400 to 0 step -25:arma=$55:armb=$55
gosub ringer:ring=0:next delay:for delay=0 to 100:ring=$ff:pause fastflash
ring=0:pause fastflash:next delay:arma=0:armb=0:for delay=400 to 0 step -25
arma=$aa:armb=$aa:gosub ringer:ring=0:next delay:for delay=0 to 100:ring=$ff
ring=$ff:pause fastflash:ring=0:pause fastflash:next delay:arma=$ff:armb=$ff
for delay=400 to 0 step -25:gosub ringer:ring=0:next delay:arma=$ff:armb=$ff
for delay=400 to 0 step -25:ring=$ff:pause delay:ring=0:pause delay
next delay:for delay=0 to 100:ring=$ff:pause fastflash:ring=0:next delay
ring=$ff:for delay=400 to 50 step -30:for temp=0 to 7 step 2:arma.0[temp]=1
armb.0[temp]=1:pause delay:arma.0[temp]=0:armb.0[temp]=0:next temp:next delay
ring=$ff:for delay=300 to 50 step -10:arma=$83:armb=$83:pause delay:arma=0
armb=0:pause delay:arma=6:armb=6:pause delay:arma=0:armb=0:arma=$30:armb=$30
pause delay:arma=0:armb=0:arma=$c0:armb=$c0:pause delay:arma=0:armb=0:armb=0
next delay:goto loop
ringer: for temp=0 to 7:ring.0[temp]=1:pause delay:ring.0[temp]=0:pause delay
next temp:return
END
Bookmarks