Code: Select all
on temp#Temperature do
if [temp#Temperature] > -15 // temp warmer then -15ºC
tone,14,1000,700
endif
endon
Moderators: grovkillen, Stuntteam, TD-er
Code: Select all
on temp#Temperature do
if [temp#Temperature] > -15 // temp warmer then -15ºC
tone,14,1000,700
endif
endon
Yeah I was thinking of making it play the imperial march but since it's going to be at my office I wasn't sure how the other teachers would reactgrovkillen wrote: ↑24 Oct 2018, 20:30 Rtttl is another command but it will block the loop during the playing. But to stop it after a while you need to use timer and possibly dummy devices to store the state (creating a kind of hysteresis).
Code: Select all
//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
//produce a short 1000hz beep via a piezo element on pin 14
tone,14,1000,700
endon
Code: Select all
cmd=event,start_warning
Code: Select all
cmd=event,stop_warning
Code: Select all
on FRYS#Temperature do
if [FRYS#Temperature] > 30 // temp warmer then -15ºC
tone,14,1000,700
endif
endon
Users browsing this forum: No registered users and 3 guests