////////////////////////////////////////////////////////////////////////////
// Callback from DioBoard.
void RockerSwitch::dioChange (bool state, DioDevice*, unsigned id)
{
// Ignore this transition if within the debounce time period.
if (lastDebounceStart + debounceLength > now() ) return;
// Save transition time to establish debounce time period.
lastDebounceStart = now();
if (state == OFF) return; // Ignore releasing the switch.
notifyClients( (id==onID) ? ON : OFF);
}
Previous slide | Next slide | Back to first slide | View graphic version |