The macros below can be used to create a "flashing light"
with LEDs that are connected to the digital output lines of
the controller. $1 and $2 are values of local variables and
must be specified as arguments of MAC START or MAC
NSTART command when starting the macros (see below).
DIO 0 <bitmask>: Sets the output channels according to
<bitmask>. For example, "DIO 0 5" activates channels 1 and
3 and deactivates all other channels (5 is 0000 0101 in
binary notation).
To implement the "flashing light", do the following steps:
1. Write the "STEPS" macro:
MAC BEG STEPS
DIO 0 $1
ADD 1 $1 1
DEL $2
JRC -3 VAR? 1 <= 15
ADD 1 $1 -1
DIO 0 $1
DEL $2
JRC -3 VAR? 1 > 0
MAC END