5
5
// PIN CONFIGURATION
6
6
#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)
7
7
// #define USE_APA102 // Uncomment for using APA102 LEDs.
8
- #define BTNPIN -1 // button pin. Needs to have pullup (gpio0 recommended)
9
- #define IR_PIN 0 // infrared pin (-1 to disable) MagicHome: 4, H801 Wifi: 0
8
+ #ifdef WLED_USE_H801
9
+ #define BTNPIN -1 // button pin. Needs to have pullup (gpio0 recommended)
10
+ #define IR_PIN 0 // infrared pin (-1 to disable) MagicHome: 4, H801 Wifi: 0
11
+ #else
12
+ #define BTNPIN 0 // button pin. Needs to have pullup (gpio0 recommended)
13
+ #define IR_PIN 4 // infrared pin (-1 to disable) MagicHome: 4, H801 Wifi: 0
14
+ #endif
10
15
#define RLYPIN -1 // pin for relay, will be set HIGH if LEDs are on (-1 to disable). Also usable for standby leds, triggers,...
11
16
#define AUXPIN -1 // debug auxiliary output pin (-1 to disable)
12
17
20
25
#endif
21
26
#endif
22
27
23
- #ifndef WLED_DISABLE_ANALOG_LEDS
28
+ #ifdef WLED_USE_ANALOG_LEDS
24
29
// PWM pins - PINs 15,13,12,14 (W2 = 04)are used with H801 Wifi LED Controller
25
- #define RPIN 15 // R pin for analog LED strip
26
- #define GPIN 13 // G pin for analog LED strip
27
- #define BPIN 12 // B pin for analog LED strip
28
- #define WPIN 14 // W pin for analog LED strip (W1: 14, W2: 04)
29
- #define W2PIN 04 // W2 pin for analog LED strip
30
- //
31
- /* PWM pins - PINs 5,12,13,15 are used with Magic Home LED Controller
32
- #define RPIN 5 //R pin for analog LED strip
33
- #define GPIN 12 //G pin for analog LED strip
34
- #define BPIN 13 //B pin for analog LED strip
35
- #define WPIN 15 //W pin for analog LED strip (W1: 14, W2: 04)
36
- */
30
+ #ifdef WLED_USE_H801
31
+ #define RPIN 15 // R pin for analog LED strip
32
+ #define GPIN 13 // G pin for analog LED strip
33
+ #define BPIN 12 // B pin for analog LED strip
34
+ #define WPIN 14 // W pin for analog LED strip (W1: 14, W2: 04)
35
+ #define W2PIN 04 // W2 pin for analog LED strip
36
+ #else
37
+ // PWM pins - PINs 5,12,13,15 are used with Magic Home LED Controller
38
+ #define RPIN 5 // R pin for analog LED strip
39
+ #define GPIN 12 // G pin for analog LED strip
40
+ #define BPIN 15 // B pin for analog LED strip
41
+ #define WPIN 13 // W pin for analog LED strip (W1: 14, W2: 04)
42
+ #endif
37
43
#endif
38
44
39
45
// automatically uses the right driver method for each platform
@@ -120,7 +126,7 @@ class NeoPixelWrapper
120
126
_pGrbw->Begin ();
121
127
break ;
122
128
123
- #ifndef WLED_DISABLE_ANALOG_LEDS
129
+ #ifdef WLED_USE_ANALOG_LEDS
124
130
// init PWM pins - PINs 5,12,13,15 are used with Magic Home LED Controller
125
131
pinMode (RPIN, OUTPUT);
126
132
pinMode (GPIN, OUTPUT);
@@ -140,7 +146,7 @@ class NeoPixelWrapper
140
146
}
141
147
}
142
148
143
- #ifndef WLED_DISABLE_ANALOG_LEDS
149
+ #ifdef WLED_USE_ANALOG_LEDS
144
150
void SetRgbwPwm (uint8_t r, uint8_t g, uint8_t b, uint8_t w, uint8_t w2=0 )
145
151
{
146
152
analogWrite (RPIN, r);
@@ -164,7 +170,7 @@ class NeoPixelWrapper
164
170
{
165
171
case NeoPixelType_Grb: {
166
172
_pGrb->Show ();
167
- #ifndef WLED_DISABLE_ANALOG_LEDS
173
+ #ifdef WLED_USE_ANALOG_LEDS
168
174
RgbColor color = _pGrb->GetPixelColor (0 );
169
175
b = _pGrb->GetBrightness ();
170
176
SetRgbwPwm (color.R * b / 255 , color.G * b / 255 , color.B * b / 255 , 0 );
@@ -173,7 +179,7 @@ class NeoPixelWrapper
173
179
break ;
174
180
case NeoPixelType_Grbw: {
175
181
_pGrbw->Show ();
176
- #ifndef WLED_DISABLE_ANALOG_LEDS
182
+ #ifdef WLED_USE_ANALOG_LEDS
177
183
RgbwColor colorW = _pGrbw->GetPixelColor (0 );
178
184
b = _pGrbw->GetBrightness ();
179
185
// check color values for Warm / COld white mix (for RGBW) // EsplanexaDevice.cpp
0 commit comments