User's Manual

123456789012345678901234567890FF
12345678901234567890123456789011,000B,02,02
12345678901234567890123456789011,000C,10,02
12345678901234567890123456789022,000E,02,02
4.4.2 Script Input
Then we start to write the script by clearing the script and enter script input mode
with following commands:
WC // Clean script
WW // Enter script input mode
We need to input following script. After finish entering script, type βESCβ key to exit.
@PW_ON
# start advertisement
A
# define range of variable $VAR1
$VAR1 < β0300β
# associate handle 0x000E to reading of AIO1
%000E = G@,1
@CONN
# set timer 1 to be around 5 seconds
SM,1,00500000
@TMR1
# read AIO0
$VAR1 = G@,0
# set handle 0x000B to the AIO0 value
SHW,000B,$VAR1
# restart timer
SM,1,00500000
After powering on, event @PW_ON is generated. The script will first start
advertisement. Then it defines the range of $VAR1 to be less than 0x0300. Finally, it
associates handle 0x000E to the analogue port AIO1, which is the temperature
sensor.
Once connection is established, event @CONN is generated. The script sets up timer
1 to expire in roughly 5 seconds.