|
1 | 1 | MicroCode programs consist of 5 pages, numbered 1 - 5. |
2 | 2 | Execution always starts on page 1. Before execution |
3 | | -starts, all variables are initialized to 0 and the current value of all sensors is cached. |
| 3 | +starts, all variables are initialized to 0 and |
| 4 | +the current value of all sensors is cached. |
4 | 5 |
|
5 | | -A page consists of a sequence of rules, ordered from top to bottom. |
6 | | -Each rule has a When section and a Do section. |
7 | | -The When section specifies an event of interest |
| 6 | +A page consists of a sequence of rules (R), ordered from top to bottom. |
| 7 | +Each rule has an option when section W and an optional do section D. |
| 8 | +The when section specifies an event of interest |
8 | 9 | and, optionally, a filter on that event. |
| 10 | +The do section specifies an action and, optionally, |
| 11 | +parameters to that action. |
| 12 | +Some actions can be repeated. |
9 | 13 |
|
10 | | -When |
| 14 | +R := [W] [D] |
11 | 15 |
|
12 | | -page-start [timespan] |
13 | | -timer [timespan] |
14 | | -press [pressable-kind] |
15 | | -release [pressable-kind] |
16 | | -move [move-kind] |
17 | | -sound [loud-quiet,compare] |
18 | | -temperature [up-down,compare] |
19 | | -light [up-down,compare] |
20 | | -magnet [up-down,compare] |
21 | | -radio-receive [compare] |
22 | | -variable-X-set [compare] |
23 | | -variable-Y-set [compare] |
24 | | -variable-Z-set [compare] |
| 16 | +W := |
| 17 | +| page-start [TS] |
| 18 | +| timer [TS] |
| 19 | +| press [PK] |
| 20 | +| release [PK] |
| 21 | +| move [MK] |
| 22 | +| sound [loud | quiet | C] |
| 23 | +| temperature [up | down | C] |
| 24 | +| light [up | down | C] |
| 25 | +| magnet [up | down | C] |
| 26 | +| radio-receive [C] |
| 27 | +| variable-X-set [C] |
| 28 | +| variable-Y-set [C] |
| 29 | +| variable-Z-set [C] |
25 | 30 |
|
26 | | -Do |
| 31 | +TS := (1/4-second | 1-second | 1-random-second | 5-seconds)\* |
| 32 | +PK := button-A | button-B | logo | pin-0 | pin-1 | pin-2 |
| 33 | +MK := shake | tilt-left | tilt-right | ... |
| 34 | +C := CO V |
27 | 35 |
|
28 | | -show-number [value] |
29 | | -show-image [image*] [repeat [pos-value]] |
30 | | -play-sound [sound*] [repeat [pos-value]] |
31 | | -play-music [notes*] [repeat [pos-value]] |
32 | | -radio-send [value] |
33 | | -radio-set-group [pos-value] |
34 | | -set-variable-X [value] |
35 | | -set-variable-Y [value] |
36 | | -set-variable-Z [value] |
37 | | -switch-page [page] |
| 36 | +D := |
| 37 | +| show-number [V] |
| 38 | +| show-image (image)_ [repeat [PV]] |
| 39 | +| play-sound (sound)_ [repeat [PV]] |
| 40 | +| play-music (notes)\* [repeat [PV]] |
| 41 | +| radio-send [V] |
| 42 | +| radio-set-group [PV] |
| 43 | +| set-variable-X [V] |
| 44 | +| set-variable-Y [V] |
| 45 | +| set-variable-Z [V] |
| 46 | +| switch-page [PG] |
| 47 | + |
| 48 | +CO := |
| 49 | +| equals |
| 50 | +| not-equals |
| 51 | +| less-then |
| 52 | +| less-then-or-equal |
| 53 | +| greater-than |
| 54 | +| greater-than-or-equal |
0 commit comments