1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
rem LEDs.bas
rem
rem last revision on 15 Aug 2002
rem

rem play a little with the LEDs :-)
rem let them blink or scroll

// see also Register Supplement for settings of &ANNUNCIATORS
REG &LEDS = &ANNUNCIATORS
CONST ALL_LEDS_ON = 0x3f3f
CONST ALL_LEDS_OFF = 0x3f00 // keep LEDs in remote mode
CONST LED1_ONLY = 0x3f20
CONST LED2_ONLY = 0x3f10
CONST LED3_ONLY = 0x3f08
CONST LED4_ONLY = 0x3f04
CONST LED5_ONLY = 0x3f02
CONST LED6_ONLY = 0x3f01

Reset_Macro:
&LEDS = ALL_LEDS_OFF

CONST BLINKING = 1
CONST SCROLLING = 2
#mode = SCROLLING
#led_on = 1
END

F1_Button_Macro:
if #mode = BLINKING then
        #mode = SCROLLING
else
        #mode = BLINKING
endif
END

Main_Macro:
if #mode = BLINKING then
        if (&TIMER1 AND 0x02) > 0 then
                 &LEDS = ALL_LEDS_OFF
         else
                 &LEDS = ALL_LEDS_ON
         endif
else
        select #led_on
        case 1:
                &LEDS = LED1_ONLY
        case 2, 10:
                &LEDS = LED2_ONLY
        case 3, 9:
                &LEDS = LED3_ONLY
        case 4, 8:
                &LEDS = LED4_ONLY
        case 5, 7:
                &LEDS = LED5_ONLY
        case 6:
                &LEDS = LED6_ONLY
         default:
                 #led_on = 1
                 &LEDS = LED1_ONLY
        endsel
        if #led_on = 10 then
                #led_on = 1
        else
                #led_on = #led_on + 1
        endif
endif
END

Download LEDs.bas
(1.4 KB , Aug. 26, 2008)