/* * Data to run the Grantronics Christmas Tree. * Program is Copyright (c) Grantronics Pty Ltd
1999. * Permission is hereby granted for
unrestricted personal * use. For commercial use of this software,
except for * sale "as is" in a kit, please contact
Grantronics Pty Ltd. *
info@grantronics.com.au * Micro/C command lines: * c:\mc\ccavr treedata.c -A -I -L -P -C * c:\mc\asmavr treedata.asm -F -I
c=treedata.hex l=treedata.lst * Last change: LG 23
Nov 1999 10:06 pm */ #define
UCHAR unsigned char #define
RED0 0 /* off */ #define
RED1 1 /* on 1/3 */ #define
RED2 2 /* on 2/3 */ #define
RED3 3 /* on 3/3
(full) */ #define
GRN0 0 /* off */ #define
GRN1 4 /* on 1/3 */ #define
GRN2 8 /* on 2/3 */ #define
GRN3 12 /* on 3/3
(full) */ /* We
don't have enought bits to set a colour and brightness in 1 byte and still have bits left over for other control
functions. So, we will have a separate "brightness and colour"
function */ #define
LED 0xff+ /* LED (-1+1..32 => 0..31 = 00..1f) */ #define
LEDDEL 0x1f+ /* LED and delay */ //
0x40..0x7f spare #define
SUB 0x80+ /* define subroutine start, 0x80..0x9f = 0..31 (value - 0x80) */ #define
CALL 0xA0+ /* subroutine call */ #define
LOOPCNT 0xC0+ /* define loop start,
0xc1..0xcf = 1..15, count = value - 0xC0 */ #define
LOOP 0xC0 /* back to loop start */ #define
COLOUR 0xd0+ /* 0xd0..0xdf for level 0..3 for red, 0..3 for green */ #define
DELAY 0xe0+ /* DELAY 0: use last delay value, max = 15, 50ms steps */ //
0xf0..0xf3 spare #define
COLOURSET1 0xf4 /* colour1 = colour */ #define
COLOURSET2 0xf5 /* colour2 = colour */ #define
COLOURSET3 0xf6 /* colour3 = colour */ #define
COLOURSET4 0xf7 /* colour4 = colour */ #define
COLOUR1 0xf8 /* colour = colour1 */ #define
COLOUR2 0xf9 /* colour = colour2 */ #define
COLOUR3 0xfa /* colour = colour3 */ #define
COLOUR4 0xfb /* colour = colour4 */ #define
RET 0xfc /* end of subroutine */ #define
ALLON 0xfd /* set all LEDs to current colour */ #define
ALLOFF 0xfe /* set all LEDs off */ #define
END 0xff /* end of pattern data */ #define
FLASH2 0 #define
RAND 1 #define
POUR_DN 2 #define
POUR_UP 3 #define
CLOCKWISE1 4 #define
ANTICLOCKWISE1 5 #define
OPPOSITES_RG 6 #define
OPPOSITES_RGY 7 #define
POINTS 8 #define
RAND_POINTS 9 #define
EDGES_DN 10 #define
POUR_EDGES 11 #define
THROB 12 #define
WORM_CW 13 #define
WORM_CW_END 14 #define
WORM_CCW 15 #define
WORM_CCW_END 16 #define
CLOCKWISE2 17 #define
ANTICLOCKWISE2 18 #define
POUR_DN_BLEND 19 UCHAR
data[] = { /*
subroutines */ SUB FLASH2, /* flashes */ LOOPCNT 3, ALLOFF,DELAY 8, ALLON,DELAY 15, LOOP, RET, SUB RAND, /*
set colour before calling */ /* Random change to current colour */ LED 5,DELAY 2, LEDDEL 24, LEDDEL 13, LEDDEL 2, LEDDEL 21, LEDDEL 10, LEDDEL 29, LEDDEL 32, LEDDEL 18, LEDDEL 7, LEDDEL 26, LEDDEL 15, LEDDEL 4, LEDDEL 23, LEDDEL 12, LEDDEL 1, LEDDEL 20, LEDDEL 9, LEDDEL 28, LEDDEL 17, LEDDEL 6, LEDDEL 25, LEDDEL 14, LEDDEL 31, LEDDEL 3, LEDDEL 22, LEDDEL 11, LEDDEL 30, LEDDEL 19, LEDDEL 8, LEDDEL 27, LEDDEL 16, DELAY 10, DELAY 10, /* now all set to new colour */ RET, SUB POUR_DN, /* set colour and speed before calling */ LEDDEL 1, LED 2,LEDDEL 32, LED 3,LEDDEL 31, LED 4,LEDDEL 30, LED 5,LEDDEL 29, LED 6,LEDDEL 28, LED 7,LEDDEL 27, LED 8,LEDDEL 26, LED 9,LEDDEL 25, LED 10,LEDDEL 24, LED 11,LEDDEL 23, LED 12,LEDDEL 22, LED 13,LEDDEL 21, LED 14,LEDDEL 20, LED 15,LEDDEL 19, LED 16,LEDDEL 18, LEDDEL 17, RET, SUB POUR_UP, /*
set colour and speed before calling */ LEDDEL 17, LED 16,LEDDEL 18, LED 15,LEDDEL 19, LED 14,LEDDEL 20, LED 13,LEDDEL 21, LED 12,LEDDEL 22, LED 11,LEDDEL 23, LED 10,LEDDEL 24, LED 9,LEDDEL 25, LED 8,LEDDEL 26, LED 7,LEDDEL 27, LED 6,LEDDEL 28, LED 5,LEDDEL 29, LED 4,LEDDEL 30, LED 3,LEDDEL 31, LED 2,LEDDEL 32, LEDDEL 1, RET, SUB CLOCKWISE2, /* Assumes a colour is set or appears as a
dot with a different colour trail */ COLOUR1, LEDDEL 1, COLOUR2, LED 1, COLOUR1, LEDDEL 2, COLOUR2, LED 2, COLOUR1, LEDDEL 3, COLOUR2, LED 3, COLOUR1, LEDDEL 4, COLOUR2, LED 4, COLOUR1, LEDDEL 5, COLOUR2, LED 5, COLOUR1, LEDDEL 6, COLOUR2, LED 6, COLOUR1, LEDDEL 7, COLOUR2, LED 7, COLOUR1, LEDDEL 8, COLOUR2, LED 8, COLOUR1, LEDDEL 9, COLOUR2, LED 9, COLOUR1, LEDDEL 10, COLOUR2, LED 10, COLOUR1, LEDDEL 11, COLOUR2, LED 11, COLOUR1, LEDDEL 12, COLOUR2, LED 12, COLOUR1, LEDDEL 13, COLOUR2, LED 13, COLOUR1, LEDDEL 14, COLOUR2, LED 14, COLOUR1, LEDDEL 15, COLOUR2, LED 15, COLOUR1, LEDDEL 16, COLOUR2, LED 16, COLOUR1, LEDDEL 17, COLOUR2, LED 17, COLOUR1, LEDDEL 18, COLOUR2, LED 18, COLOUR1, LEDDEL 19, COLOUR2, LED 19, COLOUR1, LEDDEL 20, COLOUR2, LED 20, COLOUR1, LEDDEL 21, COLOUR2, LED 21, COLOUR1, LEDDEL 22, COLOUR2, LED 22, COLOUR1, LEDDEL 23, COLOUR2, LED 23, COLOUR1, LEDDEL 24, COLOUR2, LED 24, COLOUR1, LEDDEL 25, COLOUR2, LED 25, COLOUR1, LEDDEL 26, COLOUR2, LED 26, COLOUR1, LEDDEL 27, COLOUR2, LED 27, COLOUR1, LEDDEL 28, COLOUR2, LED 28, COLOUR1, LEDDEL 29, COLOUR2, LED 29, COLOUR1, LEDDEL 30, COLOUR2, LED 30, COLOUR1, LEDDEL 31, COLOUR2, LED 31, COLOUR1, LEDDEL 32, COLOUR2, LED 32, RET, SUB ANTICLOCKWISE2, /* Assumes a colour is set or appears as a
dot with a different colour trail */ COLOUR1, LEDDEL 1, COLOUR2, LED 1, COLOUR1, LEDDEL 32, COLOUR2, LED 32, COLOUR1, LEDDEL 31, COLOUR2, LED 31, COLOUR1, LEDDEL 30, COLOUR2, LED 30, COLOUR1, LEDDEL 29, COLOUR2, LED 29, COLOUR1, LEDDEL 28, COLOUR2, LED 28, COLOUR1, LEDDEL 27, COLOUR2, LED 27, COLOUR1, LEDDEL 26, COLOUR2, LED 26, COLOUR1, LEDDEL 25, COLOUR2, LED 25, COLOUR1, LEDDEL 24, COLOUR2, LED 24, COLOUR1, LEDDEL 23, COLOUR2, LED 23, COLOUR1, LEDDEL 22, COLOUR2, LED 22, COLOUR1, LEDDEL 21, COLOUR2, LED 21, COLOUR1, LEDDEL 20, COLOUR2, LED 20, COLOUR1, LEDDEL 19, COLOUR2, LED 19, COLOUR1, LEDDEL 18, COLOUR2, LED 18, COLOUR1, LEDDEL 17, COLOUR2, LED 17, COLOUR1, LEDDEL 16, COLOUR2, LED 16, COLOUR1, LEDDEL 15, COLOUR2, LED 15, COLOUR1, LEDDEL 14, COLOUR2, LED 14, COLOUR1, LEDDEL 13, COLOUR2, LED 13, COLOUR1, LEDDEL 12, COLOUR2, LED 12, COLOUR1, LEDDEL 11, COLOUR2, LED 11, COLOUR1, LEDDEL 10, COLOUR2, LED 10, COLOUR1, LEDDEL 9, COLOUR2, LED 9, COLOUR1, LEDDEL 8, COLOUR2, LED 8, COLOUR1, LEDDEL 7, COLOUR2, LED 7, COLOUR1, LEDDEL 6, COLOUR2, LED 6, COLOUR1, LEDDEL 5, COLOUR2, LED 5, COLOUR1, LEDDEL 4, COLOUR2, LED 4, COLOUR1, LEDDEL 3, COLOUR2, LED 3, COLOUR1, LEDDEL 2, COLOUR2, LED 2, RET, SUB CLOCKWISE1, /* 1 colour: set colour and delay before calling */ LEDDEL 1, LEDDEL 2, LEDDEL 3, LEDDEL 4, LEDDEL 5, LEDDEL 6, LEDDEL 7, LEDDEL 8, LEDDEL 9, LEDDEL 10, LEDDEL 11, LEDDEL 12, LEDDEL 13, LEDDEL 14, LEDDEL 15, LEDDEL 16, LEDDEL 17, LEDDEL 18, LEDDEL 19, LEDDEL 20, LEDDEL 21, LEDDEL 22, LEDDEL 23, LEDDEL 24, LEDDEL 25, LEDDEL 26, LEDDEL 27, LEDDEL 28, LEDDEL 29, LEDDEL 30, LEDDEL 31, LEDDEL 32, RET, SUB
ANTICLOCKWISE1, /* 1 colour */ LEDDEL 1, LEDDEL 32, LEDDEL 31, LEDDEL 30, LEDDEL 29, LEDDEL 28, LEDDEL 27, LEDDEL 26, LEDDEL 25, LEDDEL 24, LEDDEL 23, LEDDEL 22, LEDDEL 21, LEDDEL 20, LEDDEL 19, LEDDEL 18, LEDDEL 17, LEDDEL 16, LEDDEL 15, LEDDEL 14, LEDDEL 13, LEDDEL 12, LEDDEL 11, LEDDEL 10, LEDDEL 9, LEDDEL 8, LEDDEL 7, LEDDEL 6, LEDDEL 5, LEDDEL 4, LEDDEL 3, LEDDEL 2, RET, SUB
OPPOSITES_RG, /* red cw + grn ccw ending
with grn and red */ COLOUR3,
LEDDEL 1, COLOUR1, LED
2, COLOUR2, LEDDEL 32, COLOUR1, LED
3, COLOUR2, LEDDEL 31, COLOUR1, LED
4, COLOUR2, LEDDEL 30, COLOUR1, LED
5, COLOUR2, LEDDEL 29, COLOUR1, LED
6, COLOUR2, LEDDEL 28, COLOUR1, LED
7, COLOUR2, LEDDEL 27, COLOUR1, LED
8, COLOUR2, LEDDEL 26, COLOUR1, LED
9, COLOUR2, LEDDEL 25, COLOUR1, LED
10, COLOUR2, LEDDEL 24, COLOUR1, LED
11, COLOUR2, LEDDEL 23, COLOUR1, LED
12, COLOUR2, LEDDEL 22, COLOUR1, LED
13, COLOUR2, LEDDEL 21, COLOUR1, LED
14, COLOUR2, LEDDEL 20, COLOUR1, LED
15, COLOUR2, LEDDEL 19, COLOUR1, LED
16, COLOUR2, LEDDEL 18, COLOUR3,
LEDDEL 17, COLOUR1, LED
18, COLOUR2, LEDDEL 16, COLOUR1, LED
19, COLOUR2, LEDDEL 15, COLOUR1, LED
20, COLOUR2, LEDDEL 14, COLOUR1, LED
21, COLOUR2, LEDDEL 13, COLOUR1, LED
22, COLOUR2, LEDDEL 12, COLOUR1, LED
23, COLOUR2, LEDDEL 11, COLOUR1, LED
24, COLOUR2, LEDDEL 10, COLOUR1, LED
25, COLOUR2, LEDDEL 9, COLOUR1, LED
26, COLOUR2, LEDDEL 8, COLOUR1, LED
27, COLOUR2, LEDDEL 7, COLOUR1, LED
28, COLOUR2, LEDDEL 6, COLOUR1, LED
29, COLOUR2, LEDDEL 5, COLOUR1, LED
30, COLOUR2, LEDDEL 4, COLOUR1, LED
31, COLOUR2, LEDDEL 3, COLOUR1, LED
32, COLOUR2, LEDDEL 2, RET, SUB
OPPOSITES_RGY, /* red cw + grn ccw
ending with all yellow */ COLOUR3,
LEDDEL 1, COLOUR1, LED
2, COLOUR2, LEDDEL 32, COLOUR1, LED
3, COLOUR2, LEDDEL 31, COLOUR1, LED
4, COLOUR2, LEDDEL 30, COLOUR1, LED
5, COLOUR2, LEDDEL 29, COLOUR1, LED
6, COLOUR2, LEDDEL 28, COLOUR1, LED
7, COLOUR2, LEDDEL 27, COLOUR1, LED
8, COLOUR2, LEDDEL 26, COLOUR1, LED
9, COLOUR2, LEDDEL 25, COLOUR1, LED
10, COLOUR2, LEDDEL 24, COLOUR1, LED
11, COLOUR2, LEDDEL 23, COLOUR1, LED
12, COLOUR2, LEDDEL 22, COLOUR1, LED
13, COLOUR2, LEDDEL 21, COLOUR1, LED
14, COLOUR2, LEDDEL 20, COLOUR1, LED
15, COLOUR2, LEDDEL 19, COLOUR1, LED
16, COLOUR2, LEDDEL 18, COLOUR3,
LEDDEL 17, COLOUR3, LED
18, LEDDEL 16, COLOUR3, LED
19, LEDDEL 15, COLOUR3, LED 20,
LEDDEL 14, COLOUR3, LED
21, LEDDEL 13, COLOUR3, LED
22, LEDDEL 12, COLOUR3, LED
23, LEDDEL 11, COLOUR3, LED
24, LEDDEL 10, COLOUR3, LED
25, LEDDEL 9, COLOUR3, LED
26, LEDDEL 8, COLOUR3, LED
27, LEDDEL 7, COLOUR3, LED
28, LEDDEL 6, COLOUR3, LED
29, LEDDEL 5, COLOUR3, LED
30, LEDDEL 4, COLOUR3, LED
31, LEDDEL 3, COLOUR3, LED
32, LEDDEL 2, RET, SUB POINTS, /* set 'points' to current colour */ LED 1, LED 3,
LED 7, LED 11, LED 15, LED 19, LED 23, LED 27, LED 31, RET, SUB
RAND_POINTS, /* flash 'points' to current
colour */ /* colour1 =
flash, colour2 = background */ COLOUR1,
LEDDEL 1, COLOUR2, LEDDEL 1, COLOUR1,
LEDDEL 7, COLOUR2, LEDDEL 7, COLOUR1,
LEDDEL 23, COLOUR2, LEDDEL 23, COLOUR1,
LEDDEL 15, COLOUR2, LEDDEL 15, COLOUR1,
LEDDEL 27, COLOUR2, LEDDEL 27, COLOUR1,
LEDDEL 19, COLOUR2, LEDDEL 19, COLOUR1,
LEDDEL 31, COLOUR2, LEDDEL 31, COLOUR1,
LEDDEL 11, COLOUR2, LEDDEL 11, COLOUR1,
LEDDEL 3, COLOUR2, LEDDEL 3, RET, SUB EDGES_DN, LED 1, LED 2,
LED 3, LED 32, LEDDEL 31, LED 4, LED 5,
LED 6, LED 7, LED 30, LED 29, LED 28, LEDDEL 27, LED 8, LED 9,
LED 10, LED 11, LED 26, LED 25, LED 24, LEDDEL 23, LED 12, LED
13, LED 14, LED 15, LED 22, LED 21, LED 20, LEDDEL 19, LED 16, LED
17, LEDDEL 18, RET, SUB
POUR_EDGES, LED 1, LED 4,
LED 30, LED 8, LED 26, LED 12, LEDDEL 22, LED 2, LED 32,
LED 5, LED 29, LED 9, LED 25, LED 13, LEDDEL 21, LED 3, LED 31,
LED 6, LED 28, LED 10, LED 24, LED 14, LEDDEL 20, LED 7, LED 27,
LED 11, LED 23, LED 15, LEDDEL 19, LED 16, LEDDEL
18, LEDDEL 17, RET, SUB THROB, /* 4 throbs,
red, yellow, green, assumes all off at start */ /* don't call
from within a loop */ LOOPCNT 4, /* red */ COLOUR RED1, ALLON, DELAY 5, COLOUR RED2, ALLON, DELAY 5, COLOUR RED3, ALLON, DELAY 5, COLOUR RED2, ALLON, DELAY 5, COLOUR RED1, ALLON, DELAY 5, ALLOFF, DELAY 5, /* yellow */ COLOUR
RED1+GRN1, ALLON, DELAY 5, COLOUR
RED2+GRN2, ALLON, DELAY 5, COLOUR RED3+GRN3, ALLON, DELAY 5, COLOUR
RED2+GRN2, ALLON, DELAY 5, COLOUR
RED1+GRN1, ALLON, DELAY 5, ALLOFF, DELAY 5, /* green */ COLOUR GRN1, ALLON, DELAY 5, COLOUR GRN2, ALLON, DELAY 5, COLOUR GRN3, ALLON, DELAY 5, COLOUR GRN2, ALLON, DELAY 5, COLOUR GRN1, ALLON, DELAY 5, ALLOFF, DELAY 5, LOOP, RET, SUB
POUR_DN_BLEND, /* set delay,
and 4 colours before calling */ DELAY 4, COLOUR1,
LEDDEL 1, /*COLOUR1,*/
LED 32, LED 2, COLOUR2, LEDDEL 1, COLOUR1, LED
31, LED 30, LED 4, LED 3, COLOUR2, LED 32, LED 2, COLOUR3, LEDDEL 1, COLOUR1, LED
29, LED 5, COLOUR2, LED 31, LED 30, LED 4, LED 3, COLOUR3, LED 32, LED 2, COLOUR4, LEDDEL 1, COLOUR1, LED
28, LED 6, COLOUR2, LED 29, LED 5, COLOUR3, LED 31, LED 30, LED 4, LED 3,
COLOUR4, LED 32, LEDDEL 2, COLOUR1, LED
27, LED 26, LED 8, LED 7, COLOUR2, LED 28, LED 6, COLOUR3, LED 29, LED 5, COLOUR4, LED 31,
LED 30, LED 4, LEDDEL 3, COLOUR1, LED
25, LED 9, COLOUR2, LED 27, LED 26, LED 8, LED 7, COLOUR3, LED 28, LED 6, COLOUR4, LED 29,
LEDDEL 5, COLOUR1, LED
24, LED 10, COLOUR2, LED 25, LED 9, COLOUR3, LED 27, LED 26, LED 8, LED 7,
COLOUR4, LED 28, LEDDEL 6, COLOUR1, LED
23, LED 22, LED 12, LED 11, COLOUR2, LED 24, LED 10, COLOUR3, LED 25, LED 9, COLOUR4, LED 27,
LED 26, LED 8, LEDDEL 7, COLOUR1, LED
21, LED 13, COLOUR2, LED 23, LED 22, LED 12, LED 11, COLOUR3, LED 24, LED 10, COLOUR4, LED 25,
LEDDEL 9, COLOUR1, LED
20, LED 18, LED 17, LED 16, LED 14, COLOUR2, LED 21, LED 13, COLOUR3, LED 23, LED 22, LED 12, LED 11,
COLOUR4, LED 24, LEDDEL 10, COLOUR1, LED
19, LED 15, COLOUR2, LED 20, LED 18, LED 17, LED 16, LED 14, COLOUR2, LED 21, LED 13, COLOUR4, LED 23,
LED 22, LED 12, LEDDEL 11, COLOUR2, LED
19, LED 15, COLOUR3, LED 20, LED 18, LED 17, LED 16, LED 14, COLOUR4, LED 21, LEDDEL 13, COLOUR3, LED
19, LED 15, COLOUR4, LED 20, LED 18, LED 17, LED 16, LEDDEL 14, COLOUR4, LED
19, LEDDEL 15, /* All colour
4 */ DELAY 15, RET, #if 0 /* here is one I started but I ran out of time... */ SUB
CHASE_CW_ST, COLOUR RED3,
LEDDEL 1, LED 2, COLOUR
RED2, LEDDEL 1, COLOUR RED3,
LED 3, COLOUR RED2, LED 2, COLOUR RED1, LEDDEL 1, RET, SUB CHASE_CW, COLOUR RED3,
LED 4, COLOUR RED2, LED 3, COLOUR RED1, LED 2, COLOUR RED0, LEDDEL 1, COLOUR RED3,
LED 5, COLOUR RED2, LED 4, COLOUR RED1, LED 3, COLOUR RED0, LEDDEL 2, COLOUR RED3,
LED 6, COLOUR RED2, LED 5, COLOUR RED1, LED 4, COLOUR RED0, LEDDEL 3, COLOUR RED3,
LED 7, COLOUR RED2, LED 6, COLOUR RED1, LED 5, COLOUR RED0, LEDDEL 4, COLOUR RED3,
LED 8, COLOUR RED2, LED 7, COLOUR RED1, LED 6, COLOUR RED0, LEDDEL 5, COLOUR RED3,
LED 9, COLOUR RED2, LED 8, COLOUR RED1, LED 7, COLOUR RED0, LEDDEL 6, COLOUR RED3,
LED 10, COLOUR RED2, LED 9, COLOUR RED1, LED 8, COLOUR RED0, LEDDEL 7, COLOUR RED3,
LED 11, COLOUR RED2, LED 10, COLOUR RED1, LED 9, COLOUR RED0, LEDDEL 8, COLOUR RED3,
LED 12, COLOUR RED2, LED 11, COLOUR RED1, LED 10, COLOUR RED0, LEDDEL 9, COLOUR RED3,
LED 13, COLOUR RED2, LED 12, COLOUR RED1, LED 11, COLOUR RED0, LEDDEL 10, COLOUR RED3,
LED 14, COLOUR RED2, LED 13, COLOUR RED1, LED 12, COLOUR RED0, LEDDEL 11, COLOUR RED3,
LED 15, COLOUR RED2, LED 14, COLOUR RED1, LED 13, COLOUR RED0, LEDDEL 12, COLOUR RED3, LED
16, COLOUR RED2, LED 15, COLOUR RED1, LED 14, COLOUR RED0, LEDDEL 13, COLOUR RED3,
LED 17, COLOUR RED2, LED 16, COLOUR RED1, LED 15, COLOUR RED0, LEDDEL 14, COLOUR RED3,
LED 18, COLOUR RED2, LED 17, COLOUR RED1, LED 16, COLOUR RED0, LEDDEL 15, COLOUR RED3,
LED 19, COLOUR RED2, LED 18, COLOUR RED1, LED 17, COLOUR RED0, LEDDEL 16, COLOUR RED3,
LED 20, COLOUR RED2, LED 19, COLOUR RED1, LED 18, COLOUR RED0, LEDDEL 17, COLOUR RED3,
LED 21, COLOUR RED2, LED 20, COLOUR RED1, LED 19, COLOUR RED0, LEDDEL 18, COLOUR RED3,
LED 22, COLOUR RED2, LED 21, COLOUR RED1, LED 20, COLOUR RED0, LEDDEL 19, COLOUR RED3,
LED 23, COLOUR RED2, LED 22, COLOUR RED1, LED 21, COLOUR RED0, LEDDEL 20, COLOUR RED3,
LED 24, COLOUR RED2, LED 23, COLOUR RED1, LED 22, COLOUR RED0, LEDDEL 21, COLOUR RED3,
LED 25, COLOUR RED2, LED 24, COLOUR RED1, LED 23, COLOUR RED0, LEDDEL 22, COLOUR RED3,
LED 26, COLOUR RED2, LED 25, COLOUR RED1, LED 24, COLOUR RED0, LEDDEL 23, COLOUR RED3,
LED 27, COLOUR RED2, LED 26, COLOUR RED1, LED 25, COLOUR RED0, LEDDEL 24, COLOUR RED3,
LED 28, COLOUR RED2, LED 27, COLOUR RED1, LED 26, COLOUR RED0, LEDDEL 25, COLOUR RED3,
LED 29, COLOUR RED2, LED 28, COLOUR RED1, LED 27, COLOUR RED0, LEDDEL 26, COLOUR RED3,
LED 30, COLOUR RED2, LED 29, COLOUR RED1, LED 28, COLOUR RED0, LEDDEL 27, COLOUR RED3,
LED 31, COLOUR RED2, LED 30, COLOUR RED1, LED 29, COLOUR RED0, LEDDEL 28, COLOUR RED3,
LED 32, COLOUR RED2, LED 31, COLOUR RED1, LED 30, COLOUR RED0, LEDDEL 29, COLOUR RED3,
LED 1, COLOUR RED2, LED 32, COLOUR RED1, LED 31, COLOUR RED0, LEDDEL 30, RET, COLOUR RED3,
LED 1, COLOUR RED2, LED 32, COLOUR RED1, LED 31, COLOUR RED0, LEDDEL 30, COLOUR RED3,
LED 1, COLOUR RED2, LED 32, COLOUR RED1, LED 31, COLOUR RED0, LEDDEL 30, COLOUR RED3,
LED 1, COLOUR RED2, LED 32, COLOUR RED1, LED 31, COLOUR RED0, LEDDEL 30, SUB
CHASE_CW_ND, COLOUR RED2,
LED 1, COLOUR RED1, LED 32, COLOUR RED0, LEDDEL 31, COLOUR RED1,
LED 1, COLOUR RED0, LEDDEL 32, COLOUR RED0,
LEDDEL 1, RET, #endif SUB WORM_CW, /* set colour and delay before calling */ COLOUR2, LED
29, COLOUR1, LEDDEL 1, COLOUR2, LED
30, COLOUR1, LEDDEL 2, COLOUR2, LED
31, COLOUR1, LEDDEL 3, COLOUR2, LED
32, COLOUR1, LEDDEL 4, COLOUR2,
LED 1, COLOUR1, LEDDEL 5, COLOUR2,
LED 2, COLOUR1, LEDDEL 6, COLOUR2,
LED 3, COLOUR1, LEDDEL 7, COLOUR2,
LED 4, COLOUR1, LEDDEL 8, COLOUR2,
LED 5, COLOUR1, LEDDEL 9, COLOUR2,
LED 6, COLOUR1, LEDDEL 10, COLOUR2,
LED 7, COLOUR1, LEDDEL 11, COLOUR2,
LED 8, COLOUR1, LEDDEL 12, COLOUR2,
LED 9, COLOUR1, LEDDEL 13, COLOUR2, LED
10, COLOUR1, LEDDEL 14, COLOUR2, LED
11, COLOUR1, LEDDEL 15, COLOUR2, LED
12, COLOUR1, LEDDEL 16, COLOUR2, LED
13, COLOUR1, LEDDEL 17, COLOUR2, LED
14, COLOUR1, LEDDEL 18, COLOUR2, LED
15, COLOUR1, LEDDEL 19, COLOUR2, LED
16, COLOUR1, LEDDEL 20, COLOUR2, LED
17, COLOUR1, LEDDEL 21, COLOUR2, LED
18, COLOUR1, LEDDEL 22, COLOUR2, LED
19, COLOUR1, LEDDEL 23, COLOUR2, LED
20, COLOUR1, LEDDEL 24, COLOUR2, LED
21, COLOUR1, LEDDEL 25, COLOUR2, LED
22, COLOUR1, LEDDEL 26, COLOUR2, LED
23, COLOUR1, LEDDEL 27, COLOUR2, LED
24, COLOUR1, LEDDEL 28, COLOUR2, LED
25, COLOUR1, LEDDEL 29, COLOUR2, LED
26, COLOUR1, LEDDEL 30, COLOUR2, LED
27, COLOUR1, LEDDEL 31, COLOUR2, LED
28, COLOUR1, LEDDEL 32, RET, SUB
WORM_CW_END, COLOUR2,
LEDDEL 29, COLOUR2,
LEDDEL 30, COLOUR2,
LEDDEL 31, COLOUR2,
LEDDEL 32, COLOUR2,
LEDDEL 1, RET, SUB WORM_CCW, /* set colour and delay before calling */ COLOUR2,
LED 5, COLOUR1, LEDDEL 1, COLOUR2,
LED 4, COLOUR1, LEDDEL 32, COLOUR2,
LED 3, COLOUR1, LEDDEL 31, COLOUR2,
LED 2, COLOUR1, LEDDEL 30, COLOUR2,
LED 1, COLOUR1, LEDDEL 29, COLOUR2, LED
32, COLOUR1, LEDDEL 28, COLOUR2, LED
31, COLOUR1, LEDDEL 27, COLOUR2, LED
30, COLOUR1, LEDDEL 26, COLOUR2, LED
29, COLOUR1, LEDDEL 25, COLOUR2, LED
28, COLOUR1, LEDDEL 24, COLOUR2, LED
27, COLOUR1, LEDDEL 23, COLOUR2, LED
26, COLOUR1, LEDDEL 22, COLOUR2, LED
25, COLOUR1, LEDDEL 21, COLOUR2, LED
24, COLOUR1, LEDDEL 20, COLOUR2, LED
23, COLOUR1, LEDDEL 19, COLOUR2, LED
22, COLOUR1, LEDDEL 18, COLOUR2, LED
21, COLOUR1, LEDDEL 17, COLOUR2, LED
20, COLOUR1, LEDDEL 16, COLOUR2, LED
19, COLOUR1, LEDDEL 15, COLOUR2, LED
18, COLOUR1, LEDDEL 14, COLOUR2, LED
17, COLOUR1, LEDDEL 13, COLOUR2, LED
16, COLOUR1, LEDDEL 12, COLOUR2, LED
15, COLOUR1, LEDDEL 11, COLOUR2, LED
14, COLOUR1, LEDDEL 10, COLOUR2, LED
13, COLOUR1, LEDDEL 9, COLOUR2, LED
12, COLOUR1, LEDDEL 8, COLOUR2, LED
11, COLOUR1, LEDDEL 7, COLOUR2, LED
10, COLOUR1, LEDDEL 6, COLOUR2,
LED 9, COLOUR1, LEDDEL 5, COLOUR2,
LED 8, COLOUR1, LEDDEL 4, COLOUR2,
LED 7, COLOUR1, LEDDEL 3, COLOUR2,
LED 6, COLOUR1, LEDDEL 2, RET, SUB
WORM_CCW_END, COLOUR2,
LEDDEL 5, COLOUR2,
LEDDEL 4, COLOUR2,
LEDDEL 3, COLOUR2,
LEDDEL 2, COLOUR2,
LEDDEL 1, RET, /* End of subroutines (first instruction after RET is not
SUB x) */ /*********************************************************************/ /* Main run-time loop */ #if 0 /* test loop to trace "ghost" LEDs - see
comments at start of Mux() in tree.c */ COLOUR 0, ALLON, DELAY 15, END, #endif COLOUR RED3, CALL
RAND, /* Random on */ COLOUR GRN3,
COLOURSET1, COLOUR RED3,
COLOURSET2, DELAY 2, LOOPCNT 3, CALL WORM_CW, LOOP, CALL
WORM_CW_END, COLOUR GRN3, DELAY 10, CALL EDGES_DN, COLOUR RED3,
COLOURSET1, COLOUR GRN3,
COLOURSET2, DELAY 2, LOOPCNT 3, CALL WORM_CCW, LOOP, CALL
WORM_CCW_END, CALL THROB, COLOUR RED3, DELAY 10, CALL
POUR_EDGES, /* all red */ /* blend to
green */ COLOUR
GRN0+RED3, COLOURSET1, /* lead colour */ COLOUR
GRN1+RED2, COLOURSET2, COLOUR
GRN2+RED1, COLOURSET3, COLOUR
GRN3+RED0, COLOURSET4, DELAY 5, CALL
POUR_DN_BLEND, /* all green
*/ /* green tree
with red flashing tips */ DELAY 5, COLOUR RED3, CALL POINTS, /* initial points */ DELAY 10, LOOPCNT 10, COLOUR GRN3, CALL POINTS, DELAY 5, COLOUR RED3, CALL POINTS, DELAY 10, LOOP, /* green tree
with red random flashing tips */ COLOUR GRN3, ALLON, DELAY 5, COLOUR RED3,
COLOURSET1, /* flash */ COLOUR GRN3,
COLOURSET2, /* non-flash */ DELAY 2, /* set flash speed */ LOOPCNT 10, CALL
RAND_POINTS, /* one sequence */ LOOP, COLOUR RED3, CALL POINTS, /* points red */ LOOPCNT 5, DELAY 10, LOOP, COLOUR
GRN3+RED3, CALL
RAND, /* Random on */ /* opposite
direction colours */ ALLOFF, DELAY
15, COLOUR RED3,
COLOURSET1, COLOUR GRN3,
COLOURSET2, COLOUR
RED2+GRN2, COLOURSET3, DELAY 2, CALL
OPPOSITES_RGY, COLOUR RED3,
COLOURSET2, COLOUR GRN3,
COLOURSET1, COLOUR
RED2+GRN2, COLOURSET3, CALL
OPPOSITES_RGY, LOOPCNT 5, /* throbbing
LED 1 */ DELAY 3, COLOUR
RED2+GRN2, LEDDEL 1, COLOUR
RED1+GRN1, LEDDEL 1, COLOUR
RED0+GRN0, LEDDEL 1, COLOUR
RED1+GRN1, LEDDEL 1, COLOUR
RED2+GRN2, LEDDEL 1, COLOUR
RED3+GRN3, LEDDEL 1, DELAY 10, LOOP, /* yellow tree
with red and green flashing tips */ COLOUR
RED1+GRN1, ALLON, DELAY 5, LOOPCNT 5, COLOUR RED3, CALL POINTS, /* points red */ DELAY 10, COLOUR GRN3, CALL POINTS, /* points green */ DELAY 10, LOOP, DELAY 10, /* red tree
with green random flashing tips */ COLOUR RED3, ALLON, DELAY 5, COLOUR GRN3,
COLOURSET1, /* flash */ COLOUR RED3,
COLOURSET2, /* non-flash */ DELAY 2, LOOPCNT 10, CALL
RAND_POINTS, /* one sequence */ LOOP, COLOUR GRN3, CALL POINTS, /* points green */ LOOPCNT 5, DELAY 10, LOOP, COLOUR 0, CALL
RAND, /* Random off */ /* green tree
with changing tips */ COLOUR GRN3, ALLON, DELAY 10, LOOPCNT 6, COLOUR
RED1+GRN3, CALL POINTS, DELAY 2, COLOUR
RED2+GRN3, CALL POINTS, DELAY 2, COLOUR
RED3+GRN3, CALL POINTS, DELAY 2, COLOUR
RED3+GRN2, CALL POINTS, DELAY 2, COLOUR
RED3+GRN1, CALL POINTS, DELAY 2, COLOUR
RED3+GRN0, CALL POINTS, DELAY 10, COLOUR
RED3+GRN1, CALL POINTS, DELAY 2, COLOUR
RED3+GRN2, CALL POINTS, DELAY 2, COLOUR
RED3+GRN3, CALL POINTS, DELAY 2, COLOUR
RED2+GRN3, CALL POINTS, DELAY 2, COLOUR
RED1+GRN3, CALL POINTS, DELAY 2, COLOUR
RED0+GRN3, CALL POINTS, DELAY 10, LOOP, /* red pour
down */ COLOUR RED3,
//+GRN0, /* off */ DELAY 4, /* set delay for pour */ CALL POUR_DN, DELAY 15, /* blend to
green */ COLOUR
GRN0+RED3, COLOURSET1, /* lead colour */ COLOUR
GRN1+RED2, COLOURSET2, COLOUR
GRN2+RED1, COLOURSET3, COLOUR
GRN3+RED0, COLOURSET4, DELAY 5, CALL
POUR_DN_BLEND, /* all green
*/ /* yellow pour
up */ COLOUR
RED2+GRN2, /* all on */ DELAY 4, /* set delay for pour */ CALL POUR_UP, DELAY 15, // ALLOFF, DELAY
15, /* red/green
opposites */ COLOUR RED3,
COLOURSET1, COLOUR GRN3,
COLOURSET2, COLOUR
RED3+GRN3, COLOURSET3, DELAY 2, LOOPCNT 5, CALL
OPPOSITES_RG, LOOP, LOOPCNT 5, COLOUR
RED2+GRN2, LEDDEL 1, COLOUR
RED1+GRN1, LEDDEL 1, COLOUR
RED0+GRN0, LEDDEL 1, COLOUR
RED1+GRN1, LEDDEL 1, COLOUR
RED2+GRN2, LEDDEL 1, COLOUR
RED3+GRN3, LEDDEL 1, DELAY 10, /* pause on yellow */ DELAY 2, /* restore delay for colour change loop */ LOOP, /* green tree
with red random flashing off tips */ COLOUR GRN3, ALLON, DELAY 5, COLOUR RED3, CALL POINTS, /* points on */ COLOUR GRN3,
COLOURSET1, /* flash */ COLOUR RED3,
COLOURSET2, /* non-flash */ DELAY 2, LOOPCNT 10, CALL
RAND_POINTS, /* one sequence */ LOOP, /* red points
*/ COLOUR RED3, CALL POINTS, /* points red */ DELAY 15, /* red points
to green, fade out green */ COLOUR GRN3, ALLON, DELAY 15, COLOUR GRN2, ALLON, DELAY 15, COLOUR GRN1, ALLON, DELAY 15, COLOUR GRN0, ALLON, DELAY 15, /* yellow on
black CCW worm */ COLOUR
RED3+GRN3, COLOURSET1, COLOUR 0,
COLOURSET2, DELAY 2, LOOPCNT 4, CALL WORM_CCW, LOOP, /* yellow CCW
fill */ COLOUR
RED3+GRN3, CALL
ANTICLOCKWISE1, DELAY 15, /* fade out
yellow */ COLOUR
RED3+GRN3, ALLON, DELAY 15, COLOUR
RED2+GRN2, ALLON, DELAY 15, COLOUR
RED1+GRN1, ALLON, DELAY 15, COLOUR
RED0+GRN0, /* off */ ALLON, DELAY 15, // CALL
RAND_ON, /* Random on */ /* CW red fill
*/ COLOUR
RED3, /* dot colour */ DELAY 1, CALL
CLOCKWISE1, COLOUR GRN3,
COLOURSET1, /* dot colour */ COLOUR RED3,
COLOURSET2, /* trail colour */ CALL
CLOCKWISE2, COLOUR GRN3, // DELAY 1, CALL
CLOCKWISE1, COLOUR RED3, // DELAY 1, CALL
ANTICLOCKWISE1, COLOUR GRN3, // DELAY 1, CALL
ANTICLOCKWISE1, /* red flashes
*/ COLOUR RED3, CALL FLASH2, /* 2 flashes */ /* green pour
down */ COLOUR GRN3, DELAY 2, /* set delay for pour */ CALL POUR_DN, /* green
flashes */ COLOUR GRN3, CALL
FLASH2, /* 2 flashes */ /* now all on
*/ /*
multi-colour edges (for photo) */ ALLOFF, DELAY 2, COLOUR
GRN3+RED0, LED 1, LED 2,
LED 3, LED 32, LED 31, COLOUR
GRN3+RED3, LED 4, LED 5,
LED 6, LED 7, LED 30, LED
29, LED 28, LED 27, COLOUR
GRN0+RED3, LED 8, LED 9,
LED 10, LED 11, LED 26, LED
25, LED 24, LED 23, COLOUR
GRN3+RED3, LED 12, LED
13, LED 14, LED 15, LED 22, LED
21, LED 20, LED 19, COLOUR
GRN3+RED0, LED 16, LED
17, LED 18, DELAY 15, DELAY 15, DELAY 15, /* blend to
green */ COLOUR
GRN0+RED3, COLOURSET1, /* lead colour */ COLOUR
GRN1+RED2, COLOURSET2, COLOUR
GRN2+RED1, COLOURSET3, COLOUR
GRN3+RED0, COLOURSET4, DELAY 5, CALL
POUR_DN_BLEND, /* all green
*/ /* colour
changing tree */ LOOPCNT 4, COLOUR
GRN3+RED1, ALLON, DELAY 2, COLOUR
GRN3+RED2, ALLON, DELAY 0, COLOUR
GRN3+RED3, ALLON, DELAY 0, COLOUR
GRN2+RED3, ALLON, DELAY 0, COLOUR
GRN1+RED3, ALLON, DELAY 0, COLOUR
GRN0+RED3, ALLON, DELAY 6, COLOUR
GRN1+RED3, ALLON, DELAY 2, COLOUR
GRN2+RED3, ALLON, DELAY 0, COLOUR
GRN3+RED3, ALLON, DELAY 0, COLOUR
GRN3+RED2, ALLON, DELAY 0, COLOUR
GRN3+RED1, ALLON, DELAY 0, COLOUR
GRN3+RED0, ALLON, DELAY 6, LOOP, /* black pour
down */ COLOUR 0, DELAY 2, /* set delay for pour */ CALL POUR_DN, /* colour
change (rainbow) down */ // LOOPCNT 3, COLOUR GRN3, CALL
RAND, /* Random on */ DELAY 10, /* All green
*/ // LOOPCNT 3, COLOUR
GRN3+RED0, COLOURSET1, /* lead colour */ COLOUR
GRN2+RED1, COLOURSET2, COLOUR
GRN1+RED2, COLOURSET3, COLOUR
GRN0+RED3, COLOURSET4, DELAY 5, CALL
POUR_DN_BLEND, /* all red */ // LOOP, COLOUR
GRN0+RED3, COLOURSET1, /* lead colour */ COLOUR
GRN1+RED2, COLOURSET2, COLOUR
GRN2+RED1, COLOURSET3, COLOUR
GRN3+RED0, COLOURSET4, DELAY 5, CALL
POUR_DN_BLEND, /* all green
*/ COLOUR
GRN3+RED1, COLOURSET1, /* lead colour */ COLOUR
GRN3+RED2, COLOURSET2, COLOUR
GRN3+RED3, COLOURSET3, COLOUR
GRN2+RED2, COLOURSET4, DELAY 5, CALL
POUR_DN_BLEND, /* all yellow
*/ COLOUR GRN3+RED3,
COLOURSET1, /* lead colour */ COLOUR
GRN2+RED3, COLOURSET2, COLOUR
GRN1+RED3, COLOURSET3, COLOUR
GRN0+RED3, COLOURSET4, DELAY 5, CALL
POUR_DN_BLEND, /* all red */ COLOUR
GRN3+RED0, COLOURSET1, /* lead colour */ COLOUR
GRN2+RED0, COLOURSET2, COLOUR
GRN1+RED0, COLOURSET3, COLOUR
GRN0+RED0, COLOURSET4, DELAY 5, CALL
POUR_DN_BLEND, /* all black
*/ COLOUR
GRN1+RED0, COLOURSET1, /* lead colour */ COLOUR
GRN1+RED1, COLOURSET2, COLOUR
GRN2+RED1, COLOURSET3, COLOUR
GRN2+RED2, COLOURSET4, DELAY 5, CALL
POUR_DN_BLEND, /* all yellow
*/ // LOOP, COLOUR 0, CALL
RAND, /* Random off */ DELAY 10, DELAY 5, COLOUR
GRN1+RED0, LEDDEL 1, COLOUR
GRN2+RED1, LED 32, LEDDEL 2, COLOUR
GRN3+RED2, LED 31, LED 30, LED 4, LEDDEL 3, COLOUR
GRN3+RED3, LED 29, LEDDEL 5, COLOUR
GRN3+RED2, LED 28, LEDDEL 6, COLOUR
GRN3+RED1, LED 27, LED 26, LED 8, LEDDEL 7, COLOUR
GRN2+RED0, LED 25, LEDDEL 9, COLOUR
GRN1+RED1, LED 24, LEDDEL 10, COLOUR
GRN0+RED2, LED 23, LED 22, LED 12, LEDDEL 11, COLOUR
GRN1+RED3, LED 21, LEDDEL 13, COLOUR
GRN2+RED3, LED 20, LEDDEL 14, COLOUR
GRN3+RED3, LED 19, LED 18, LED 17, LED 16, LEDDEL 15, DELAY 15, DELAY 15, DELAY 15, END /*
end of data */ }; |
:
//
CBuild/
JavaScript 1.2-5.6/
Delifi6/
I2C /
AVR /
/
AHDL/
VHDL/
LPT EPP/ LPT ECP/ PCI/ COM port/ I2C/ RS-232/
Используются технологии uCoz
|