//~~STARTUP // Code to execute when unit starts up show_charge=10 //~~TIMER // Code to execute every TIMER_INTERVAL milliseconds // when plugged in, LED shows green for 10 seconds, whereafter it returns to normal if (CHARGE_STATUS=1) { if (show_charge>0) { show_charge-- led=1 } else OVERRIDE_LED=0 } if (CHARGE_STATUS=0) { show_charge=10 //show charging for x seconds OVERRIDE_LED=0 } //~~CALL // Code to execute when receiving an incoming call //~~SMS if (stringpos(SMS_MESSAGE$,"status")>0) { returnString$ = "Position:" + GPS_LAT + "," + GPS_LNG; returnString$ = returnString$ + ", Speed:" + GPS_SPEED+ "km/h"; returnString$ = returnString$ + ", Battery:" + VOLT_BATT + "V"; returnString$ = returnString$ + ", Supply:" + VOLT_SUPPLY + "V"; returnString$ = returnString$ + ", USB:" + VOLT_USB + "V"; returnString$ = returnString$ + ", GSM Signal:" + GSM_SIGNAL + "%" ; returnString$ = returnString$ + ", Input1:" + IO1 + "V" ; returnString$ = returnString$ + ", Input2:" + IO2 + "V" ; if (IO3=0) returnString$ = returnString$ + ", Input3: Low"; else returnString$ = returnString$ + ", Input3: High"; sendSMS(SMS_NUMBER$,returnString$); } //~~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