From e537a1297cfbb6ce1f53b024bf3321a6196e620b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Sun, 23 Oct 2016 21:11:32 +0200 Subject: [PATCH] Swapped functions for double and long click, changed blink mode --- code/src/button.ino | 4 ++-- code/src/main.ino | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/code/src/button.ino b/code/src/button.ino index 6c6ea59f..6fc2aa3e 100644 --- a/code/src/button.ino +++ b/code/src/button.ino @@ -22,7 +22,7 @@ void buttonSetup() { 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(); + if (button1.getEvent() == EVENT_DOUBLE_CLICK) createAP(); + if (button1.getEvent() == EVENT_LONG_CLICK) ESP.reset(); } } diff --git a/code/src/main.ino b/code/src/main.ino index 682e79ff..6d6e81e0 100644 --- a/code/src/main.ino +++ b/code/src/main.ino @@ -54,7 +54,11 @@ void blink(unsigned long delayOff, unsigned long delayOn) { void showStatus() { if (wifiConnected()) { - blink(5000, 500); + if (WiFi.getMode() == WIFI_AP) { + blink(2000, 2000); + } else { + blink(5000, 500); + } } else { blink(500, 500); }