@@ -46,7 +46,7 @@ uint8_t currentPatternIndex = 0; // Index number of which pattern is current
46
46
uint8_t gHue = 0 ; // rotating "base color" used by many of the patterns
47
47
48
48
uint8_t power = 1 ;
49
- uint8_t brightness = 64 ;
49
+ uint8_t brightness = 8 ;
50
50
51
51
uint8_t speed = 30 ;
52
52
@@ -69,13 +69,16 @@ unsigned long paletteTimeout = 0;
69
69
70
70
#define ARRAY_SIZE (A ) (sizeof (A) / sizeof ((A)[0 ]))
71
71
72
- #define DATA_PIN 12
72
+ #define DATA_PIN 12 // pins tested so far on the Feather ESP32: 13, 12, 27, 33, 15, 32, 14, SCL
73
73
// #define CLK_PIN 4
74
74
#define LED_TYPE WS2812B
75
- #define COLOR_ORDER GRB
76
- #define NUM_LEDS 4 * 14
75
+ #define COLOR_ORDER RGB
76
+ #define NUM_STRIPS 8
77
+ #define NUM_LEDS_PER_STRIP 100
78
+ #define NUM_LEDS NUM_LEDS_PER_STRIP * NUM_STRIPS
77
79
CRGB leds[NUM_LEDS];
78
80
81
+ #define MILLI_AMPS 4000 // IMPORTANT: set the max milli-Amps of your power supply (4A = 4000mA)
79
82
#define FRAMES_PER_SECOND 120
80
83
81
84
// -- The core to run FastLED.show()
@@ -107,7 +110,6 @@ static TaskHandle_t userTaskHandle = 0;
107
110
void FastLEDshowESP32 ()
108
111
{
109
112
if (userTaskHandle == 0 ) {
110
- const TickType_t xMaxBlockTime = pdMS_TO_TICKS ( 200 );
111
113
// -- Store the handle of the current task, so that the show task can
112
114
// notify it when it's done
113
115
userTaskHandle = xTaskGetCurrentTaskHandle ();
@@ -116,6 +118,7 @@ void FastLEDshowESP32()
116
118
xTaskNotifyGive (FastLEDshowTaskHandle);
117
119
118
120
// -- Wait to be notified that it's done
121
+ const TickType_t xMaxBlockTime = pdMS_TO_TICKS ( 200 );
119
122
ulTaskNotifyTake (pdTRUE, xMaxBlockTime);
120
123
userTaskHandle = 0 ;
121
124
}
@@ -126,11 +129,10 @@ void FastLEDshowESP32()
126
129
*/
127
130
void FastLEDshowTask (void *pvParameters)
128
131
{
129
- const TickType_t xMaxBlockTime = pdMS_TO_TICKS ( 500 );
130
132
// -- Run forever...
131
133
for (;;) {
132
134
// -- Wait for the trigger
133
- ulTaskNotifyTake (pdTRUE, xMaxBlockTime );
135
+ ulTaskNotifyTake (pdTRUE, portMAX_DELAY );
134
136
135
137
// -- Do the show (synchronously)
136
138
FastLED.show ();
@@ -181,15 +183,29 @@ void setup() {
181
183
SPIFFS.begin ();
182
184
listDir (SPIFFS, " /" , 1 );
183
185
184
- loadFieldsFromEEPROM (fields, fieldCount);
186
+ // loadFieldsFromEEPROM(fields, fieldCount);
185
187
186
188
setupWifi ();
187
189
setupWeb ();
188
190
189
- // tell FastLED about the LED strip configuration
190
- FastLED.addLeds <LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection (TypicalLEDStrip);
191
+ // three-wire LEDs (WS2811, WS2812, NeoPixel)
192
+ // FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
193
+
194
+ // four-wire LEDs (APA102, DotStar)
191
195
// FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
192
196
197
+ // Parallel output: 13, 12, 27, 33, 15, 32, 14, SCL
198
+ FastLED.addLeds <LED_TYPE, 13 , COLOR_ORDER>(leds, 0 , NUM_LEDS_PER_STRIP).setCorrection (TypicalLEDStrip);
199
+ FastLED.addLeds <LED_TYPE, 12 , COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP).setCorrection (TypicalLEDStrip);
200
+ FastLED.addLeds <LED_TYPE, 27 , COLOR_ORDER>(leds, 2 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP).setCorrection (TypicalLEDStrip);
201
+ FastLED.addLeds <LED_TYPE, 33 , COLOR_ORDER>(leds, 3 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP).setCorrection (TypicalLEDStrip);
202
+ FastLED.addLeds <LED_TYPE, 15 , COLOR_ORDER>(leds, 4 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP).setCorrection (TypicalLEDStrip);
203
+ FastLED.addLeds <LED_TYPE, 32 , COLOR_ORDER>(leds, 5 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP).setCorrection (TypicalLEDStrip);
204
+ FastLED.addLeds <LED_TYPE, 14 , COLOR_ORDER>(leds, 6 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP).setCorrection (TypicalLEDStrip);
205
+ FastLED.addLeds <LED_TYPE, SCL, COLOR_ORDER>(leds, 7 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP).setCorrection (TypicalLEDStrip);
206
+
207
+ FastLED.setMaxPowerInVoltsAndMilliamps (5 , MILLI_AMPS);
208
+
193
209
// set master brightness control
194
210
FastLED.setBrightness (brightness);
195
211
0 commit comments