mirror of
https://github.com/wled/WLED.git
synced 2025-07-25 11:46:34 +00:00
Ignore analogue pin -1 on ESP8266
This commit is contained in:
parent
664fad96fa
commit
7685f9b73d
@ -148,7 +148,11 @@ void handleButton()
|
|||||||
static unsigned long lastRead = 0UL;
|
static unsigned long lastRead = 0UL;
|
||||||
|
|
||||||
for (uint8_t b=0; b<WLED_MAX_BUTTONS; b++) {
|
for (uint8_t b=0; b<WLED_MAX_BUTTONS; b++) {
|
||||||
|
#ifdef ESP8266
|
||||||
|
if ((btnPin[b]<0 && buttonType[b] != BTN_TYPE_ANALOG) || buttonType[b] == BTN_TYPE_NONE) continue;
|
||||||
|
#else
|
||||||
if (btnPin[b]<0 || buttonType[b] == BTN_TYPE_NONE) continue;
|
if (btnPin[b]<0 || buttonType[b] == BTN_TYPE_NONE) continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (buttonType[b] == BTN_TYPE_ANALOG && millis() - lastRead > 250) { // button is not a button but a potentiometer
|
if (buttonType[b] == BTN_TYPE_ANALOG && millis() - lastRead > 250) { // button is not a button but a potentiometer
|
||||||
if (b+1 == WLED_MAX_BUTTONS) lastRead = millis();
|
if (b+1 == WLED_MAX_BUTTONS) lastRead = millis();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user