Only disable the button pin if it conflicts with one of the APA102 pins.

This commit is contained in:
Thomas Arens 2019-05-01 16:52:22 +02:00
parent 126b70f781
commit 9b7db548a2

View File

@ -3,13 +3,16 @@
#define NpbWrapper_h #define NpbWrapper_h
//PIN CONFIGURATION //PIN CONFIGURATION
#define BTNPIN 0 //button pin. Needs to have pullup (gpio0 recommended)
//#define USE_APA102 // Uncomment for using APA102 LEDs. //#define USE_APA102 // Uncomment for using APA102 LEDs.
#ifdef USE_APA102 #ifdef USE_APA102
#define CLKPIN 0 #define CLKPIN 0
#define DATAPIN 2 #define DATAPIN 2
#else #if BTNPIN == CLKPIN || BTNPIN == DATAPIN
#define BTNPIN 0 //button pin. Needs to have pullup (gpio0 recommended) #undef BTNPIN // Deactivate button pin if it conflicts with one of the APA102 pins.
#endif
#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 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 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,... #define RLYPIN 12 //pin for relay, will be set HIGH if LEDs are on (-1 to disable). Also usable for standby leds, triggers,...