//~~STARTUP // Code to execute when unit starts up TIMER_INTERVAL = 1000 //~~TIMER // Code to execute every TIMER_INTERVAL milliseconds // e.g. to execute code every 5 seconds, type: TIMER_INTERVAL=5000 seconds++ if (seconds>60) { webstring$ = humidity+","+temperature+","+VOLT_SUPPLY+","+VOLT_BATT+","+CHARGE_STATUS+","+GSM_SIGNAL+","+IO1+","+IO2 sendData(webstring$) seconds=0 } if (SB_read(5) != 5) return val1 = SB_next_value() val2 =SB_next_value() val3 = SB_next_value() val4 = SB_next_value() val5 = SB_next_value() parity= (val1+val2+val3+val4) & 255 if (parity=val5) { humidity= (val1*256 + val2)/10 temperature = (val3*256 + val4)/10 success++ } else errors++ //~~CALL // Code to execute when receiving an incoming call //~~SMS // Code to execute when receiving an SMS //~~MOVEMENT // Code to execute when detecting movement. // The movement intensity is stored in ACC_DETECT, as well as ACC_X, AXX_Y and AXX_Z //~~USSD // Code to execute when receiving a reply from a USSD string. // Reply is stored in INCOMING_USSD$ string //~~GPRS // Code to execute when receiving GPRS data. // Data is stored in INCOMING_GPRS$ string