<!-- SC_OFF --><div class=“md”><p>Hi everyone,</p> <p>I am trying to display a series of successive frames on a 16 * 16 WS2812B LED Matrix using an ESP32. I am trying it out with 3 frames. For some reason, it is getting stuck at frame 1 (Swiss flag). Here's the code:</p> <p><code>#include <FastLED.h></code></p> <p><code>#define NUM_LEDS 16*16</code></p> <p><code>#define DATA_PIN 4</code></p> <p><code>CRGB leds[NUM_LEDS];</code></p> <p><code>void setup() {</code></p> <p><code>FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);</code></p> <p><code>}</code></p> <p>​</p> <p><code>void setDisplay(CRGB frame[16][16]){int count = 0;int sign = -1;int rowIndex = 0;</code></p> <p><code>for(int i = 0; i < 16; i++){</code></p> <p><code>for(int j = 0; j < 16; j++){</code></p> <p><code>if(sign < 0){</code></p> <p><code>rowIndex = 16 - j -1;}</code></p> <p><code>else{rowIndex = j;}</code></p> <p><code>leds[count] = frame[i][rowIndex];count++;}sign *= -1;</code></p> <p><code>}</code></p> <p><code>}</code></p> <p><code>void loop(){</code></p> <p><code>CRGB frame1[16][16] = {{0xfe0000, 0xfe0000,…, 0xfe0000, 0xfe0000}};</code></p> <p><code>CRGB frame2[16][16] = {{0xf9f9f8, 0x406c9a,…, 0xe21c36, 0xf3e5e7}};</code></p> <p><code>CRGB frame3[16][16] = {{0xff0000, 0xff0000,…, 0xff0000, 0xff0000}};</code></p> <p><code>while(1){</code></p> <p><code>setDisplay(frame1); // Swiss</code> <a href=“https://flagFastLED.show”><code>flag</code></a></p> <p><a href=“https://flagFastLED.show”><code>FastLED.show</code></a><code>();</code></p> <p><code>delay(2000);</code></p> <p><code>setDisplay(frame2); // French flag</code></p> <p><a href=“https://FastLED.show”><code>FastLED.show</code></a><code>();</code></p> <p><code>delay(2000);</code></p> <p><code>setDisplay(frame3); // Red screen</code></p> <p><a href=“https://FastLED.show”><code>FastLED.show</code></a><code>();</code></p> <p><code>delay(2000);}</code></p> <p><code>}</code></p> <p>​</p> <p>I tried switching the order of <code>delay</code> and <code>FastLED.show</code> after calling <code>setDisplay</code>, and this time it got to the French Flag but then got stuck there, never made it to the last frame (the red screen). [video]</p> <p>I did try to insert a counter inside of the while loop and Serial.print the value to make sure the loop is running and it is; the counter keeps going up.</p> <p>I would greatly appreciate any help! I do not know what is going wrong and why…</p> <p>Thanks!</p> <p><a href=“https://reddit.com/link/14ubo0s/video/0kxbyyx3csab1/player”>https://reddit.com/link/14ubo0s/video/0kxbyyx3csab1/player</a></p> </div><!-- SC_ON --> submitted by <a href=“https://old.reddit.com/user/vishan_1”> /u/vishan_1 </a> <br/> <span><a href=“https://old.reddit.com/r/FastLED/comments/14ubo0s/frames_getting_stuck_with_esp32_and_16_by_16_led/”>[link]</a></span> <span><a href=“https://old.reddit.com/r/FastLED/comments/14ubo0s/frames_getting_stuck_with_esp32_and_16_by_16_led/”>[comments]</a></span>