Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
652 B

/*
ESPurna
BUTTON MODULE
Copyright (C) 2016 by Xose Pérez <xose dot perez at gmail dot com>
*/
#include <DebounceEvent.h>
DebounceEvent button1 = false;
// -----------------------------------------------------------------------------
// BUTTON
// -----------------------------------------------------------------------------
void buttonSetup() {
button1 = DebounceEvent(BUTTON_PIN);
}
void buttonLoop() {
if (button1.loop()) {
if (button1.getEvent() == EVENT_SINGLE_CLICK) toggleRelay();
if (button1.getEvent() == EVENT_LONG_CLICK) createAP();
if (button1.getEvent() == EVENT_DOUBLE_CLICK) ESP.reset();
}
}