From 9b7db548a261935a0ca4cfc19f99dad3520dab8a Mon Sep 17 00:00:00 2001 From: Thomas Arens Date: Wed, 1 May 2019 16:52:22 +0200 Subject: [PATCH] Only disable the button pin if it conflicts with one of the APA102 pins. --- wled00/NpbWrapper.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wled00/NpbWrapper.h b/wled00/NpbWrapper.h index 9387054e..0ca8344f 100644 --- a/wled00/NpbWrapper.h +++ b/wled00/NpbWrapper.h @@ -3,13 +3,16 @@ #define NpbWrapper_h //PIN CONFIGURATION +#define BTNPIN 0 //button pin. Needs to have pullup (gpio0 recommended) //#define USE_APA102 // Uncomment for using APA102 LEDs. #ifdef USE_APA102 #define CLKPIN 0 #define DATAPIN 2 -#else - #define BTNPIN 0 //button pin. Needs to have pullup (gpio0 recommended) + #if BTNPIN == CLKPIN || BTNPIN == DATAPIN + #undef BTNPIN // Deactivate button pin if it conflicts with one of the APA102 pins. + #endif #endif + #define LEDPIN 2 //strip pin. Any for ESP32, gpio2 or 3 is recommended for ESP8266 (gpio2/3 are labeled D4/RX on NodeMCU and Wemos) #define IR_PIN 4 //infrared pin (-1 to disable) #define RLYPIN 12 //pin for relay, will be set HIGH if LEDs are on (-1 to disable). Also usable for standby leds, triggers,...