MCPcopy Create free account
hub / github.com/DanielOgorchock/ST_Anything / runInterruptEnded

Method runInterruptEnded

Arduino/libraries/ST_Anything/IS_Button.cpp:71–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69 }
70
71 void IS_Button::runInterruptEnded()
72 {
73 //Serial.println("IS_Button: in runInterruptEnded()");
74 //Serial.println(millis());
75 //Serial.println(m_lTimeBtnPressed);
76 //Serial.println(m_lreqNumMillisHeld);
77
78 if (!m_bFirstRun) //Prevent sending data to SmartThings during initial startup
79 {
80 if (millis() < (m_lTimeBtnPressed + m_lreqNumMillisHeld))
81 {
82 //add the "pushed" event to the buffer to be queued for transfer to SmartThings
83 Everything::sendSmartString(getName() + F(" pushed"));
84 }
85 else if (millis() >= (m_lTimeBtnPressed + m_lreqNumMillisHeld))
86 {
87 //add the "held" event to the buffer to be queued for transfer to SmartThings
88 Everything::sendSmartString(getName() + F(" held"));
89 }
90 }
91 else
92 {
93 m_bFirstRun = false;
94 }
95
96 }
97
98}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected