Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04
Fork of smartRamalKW by
boxAlarm.cpp
00001 #include "boxAlarm.h" 00002 00003 BoxAlarm::BoxAlarm(){ 00004 00005 } 00006 00007 void BoxAlarm::init(){ 00008 boxSensor.mode(PullNone); 00009 // if(isAlarmEnabled(ALARME_CAIXA)){ 00010 // boxSensor.rise(this, &BoxAlarm::stateChanged); 00011 // boxSensor.fall(this, &BoxAlarm::stateChanged); 00012 // } 00013 } 00014 00015 void BoxAlarm::stateChanged(){ 00016 bool state = boxSensor; 00017 ledBox = state; 00018 DEBUG(printf("[BOX ALARM] STATE = %d\r\n", state)); 00019 alarm.writeAlarm(ALARME_CAIXA, state, getAlarmState(ALARME_CAIXA)); 00020 } 00021 00022 void BoxAlarm::checkState(){ 00023 bool state = boxSensor; 00024 ledBox = state; 00025 if(state != getAlarmState(ALARME_CAIXA)){ 00026 DEBUG(printf("[BOX ALARM] STATE = %d\r\n", state)); 00027 alarm.writeAlarm(ALARME_CAIXA, state, getAlarmState(ALARME_CAIXA)); 00028 } 00029 }
Generated on Thu Jul 14 2022 00:24:57 by
1.7.2
