45 lines
1.0 KiB
Plaintext
45 lines
1.0 KiB
Plaintext
on System#Boot do
|
|
GPIO,2,0
|
|
LoopTimerSet,1,2
|
|
rtttl,14:d=4,o=5,b=180:8f,8f,8f,2a#.,2f.6,8d#6,8d6,8c6,2a#.6,f.6,8d#6,8d6,8c6,2a#.6,f.6,8d#6,8d6,8d#6,2c6,p,8f,8f,8f,2a#.,2f.6,8d#6,8d6,8c6,2a#.6,f.6,8d#6,8d6,8c6,2a#.6,f.6,8d#6,8d6,8d#6,2c6
|
|
endon
|
|
|
|
on System#Reboot do
|
|
GPIO,2,0
|
|
endon
|
|
|
|
on laag#State do
|
|
LogEntry,'laag#State: %eventvalue1% result: %eventvalue2%'
|
|
endon
|
|
if [laag#State]=1
|
|
GPIO,2,0
|
|
timerSet,1,2
|
|
|
|
else
|
|
GPIO,2,1
|
|
timerSet,1,0
|
|
endif
|
|
|
|
|
|
//start the warning signal when we receive a start_warning event:
|
|
On start_warning do
|
|
timerSet,1,2
|
|
endon
|
|
|
|
//stop the warning signal when we receive a stop_warning event:
|
|
On stop_warning do
|
|
timerSet,1,0
|
|
endon
|
|
|
|
//create an actual warning signal, every time timer 1 expires:
|
|
On Rules#Timer=1 do
|
|
//repeat after 2 seconds
|
|
timerSet,1,2
|
|
|
|
//pulse some led on pin 4 shortly
|
|
//Pulse,4,1,100
|
|
|
|
//produce a short 1000hz beep via a piezo element on pin 14
|
|
//tone,14,1000,100
|
|
|
|
endon |