Browse Source

Swapped functions for double and long click, changed blink mode

fastled
Xose Pérez 8 years ago
parent
commit
e537a1297c
2 changed files with 7 additions and 3 deletions
  1. +2
    -2
      code/src/button.ino
  2. +5
    -1
      code/src/main.ino

+ 2
- 2
code/src/button.ino View File

@ -22,7 +22,7 @@ void buttonSetup() {
void buttonLoop() { void buttonLoop() {
if (button1.loop()) { if (button1.loop()) {
if (button1.getEvent() == EVENT_SINGLE_CLICK) toggleRelay(); if (button1.getEvent() == EVENT_SINGLE_CLICK) toggleRelay();
if (button1.getEvent() == EVENT_LONG_CLICK) createAP();
if (button1.getEvent() == EVENT_DOUBLE_CLICK) ESP.reset();
if (button1.getEvent() == EVENT_DOUBLE_CLICK) createAP();
if (button1.getEvent() == EVENT_LONG_CLICK) ESP.reset();
} }
} }

+ 5
- 1
code/src/main.ino View File

@ -54,7 +54,11 @@ void blink(unsigned long delayOff, unsigned long delayOn) {
void showStatus() { void showStatus() {
if (wifiConnected()) { if (wifiConnected()) {
blink(5000, 500);
if (WiFi.getMode() == WIFI_AP) {
blink(2000, 2000);
} else {
blink(5000, 500);
}
} else { } else {
blink(500, 500); blink(500, 500);
} }


Loading…
Cancel
Save