Please wait while we prepare your presentation...

Programming the SIB™


The Freezer app wakes on a 20 minute timer and checks the temperature of the freezer. If the freezer is too warm, a notification is sent to you. The SiB will continue sending notifications as long as the temperature continues to get warmer. Once the temperature is stable, or receding, the notifications stop. The app also sends a notification if the freezer is too cold. To preserve power, the app runs the temperature sensor code before initiating the WiFi connection. If there is no notification to send, the SiB powers off immediately.

PROG readtemp
PREW ; this line instructs the SiB not to initiate a WiFi connection
; until a POST command is encountered
; this allows your program to run and read sensors with less power use
INIT counter=0 ; a variable to count how many times this has run
INIT lasttemp=0 ; the variable lasttemp is used to compare
; the current temperature in the freezer to the last measured temperature
TEMP myval ; read the freezer temperature into a variable named myval
; if the freezer is colder than -25 degrees celcius
; connect to WiFi and notify the owner
IF myval < -25
POST
IM Freezer appears to cold at myval Celsius
EI

; if the freezer is warmer than -17 degrees celcius and getting warmer
IF myval > -17 and myval>lasttemp
POST
IM Freezer temp above normal, at myval Celsius
EI

; increment our run counter
SET counter=counter+1
; at 20 minute intervals, 72 runs represents a full day
; send a daily notification regardless of the temperature
; and the current battery level
if counter >= 72
POST
TILE Freezer temperature is myval °C
SET counter=0
EI

SET lasttemp=myval
SL 20m
LOOP

TO SUBMIT THIS PROGRAM:
Send MODE SID to your SiB, as this is a SID program. It is not activated by the button press but rather by a timed sensor event.
Next, send the above program in an IM to your SiB, and press your SiB to receive the program.
Finally, place your SiB in your freezer.