From fa55b945285df13f7932b97c01bbd07d52568b2c Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Sun, 9 Jan 2022 15:01:16 +0100 Subject: [PATCH] Bugfix for analog button read limitation. --- wled00/button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/button.cpp b/wled00/button.cpp index 96cdfed5a..6ac63babe 100644 --- a/wled00/button.cpp +++ b/wled00/button.cpp @@ -221,9 +221,9 @@ void handleButton() if (usermods.handleButton(b)) continue; // did usermod handle buttons if ((buttonType[b] == BTN_TYPE_ANALOG || buttonType[b] == BTN_TYPE_ANALOG_INVERTED) && millis() - lastRead > 250) { // button is not a button but a potentiometer - if (b+1 == WLED_MAX_BUTTONS) lastRead = millis(); handleAnalog(b); continue; } + if (b+1 == WLED_MAX_BUTTONS) lastRead = millis(); //button is not momentary, but switch. This is only suitable on pins whose on-boot state does not matter (NOT gpio0) if (buttonType[b] == BTN_TYPE_SWITCH || buttonType[b] == BTN_TYPE_PIR_SENSOR) {