Description
Originally posted by @MrBroccoliJP in #375 (comment)
I suspect my issue is related to this [#375] so I'm gonna leave my feedback here. Please feel free to request any additional information. Aspiring junior dev here so I'm sorry in advance for the lack of any info,
I have a neopixel clock which the code works fine for Esp32 core <v3.0.0.
I tested the latest neopixel release, it no longer crashes immediately after uploading the sketch.This specific function works fine in Esp32 Core 2.0.17:
[fades the dots of the clock in and out every second, rough code not optimized wip]void fade_tick(short int x_loc, short int y_loc_led1, short int y_loc_led2) { short int correction; if ((millis() - tmp_millis) > 500 && (millis() - tmp_millis) <= 1000) { if (r_tmp != r) { r_dec = double(r) / 23; r_tmp = (r_tmp + r_dec <= r) ? (r_tmp + r_dec) : r; } if (g_tmp != g) { g_dec = double(g) / 25; g_tmp = (g_tmp + g_dec <= g) ? (g_tmp + g_dec) : g; } if (b_tmp != b) { b_dec = double(b) / 24; b_tmp = (b_tmp + b_dec <= b) ? (b_tmp + b_dec) : b; } //fade in tick until 500miliseconds (1/2 second) } else if ((millis() - tmp_millis) < 500 && (millis() - tmp_millis) <= 1000) { if (r_tmp != 0) { r_dec = double(r) / 25; r_tmp = (r_tmp - r_dec >= 0) ? (r_tmp - r_dec) : 0; } if (g_tmp != 0) { g_dec = double(g) / 23; g_tmp = (g_tmp - g_dec >= 0) ? (g_tmp - g_dec) : 0; } if (b_tmp != 0) { b_dec = double(b) / 24; b_tmp = (b_tmp - b_dec >= 0) ? (b_tmp - b_dec) : 0; } //fade out tick until 1000miliseconds (full second) } else if (((millis() - tmp_millis) > 1000) && ((millis() - tmp_millis) < 1999)) { //in this case tmp_millis might be misaligned with the seconds, so this tries to correct it. correction = 1000 - (millis() - tmp_millis); tmp_millis = millis() - correction; } else if ((millis() - tmp_millis) >= 2000) { tmp_millis = millis() + country.ms(); //correct it with ms from eztime } uint16_t color = matrix.Color(int(r_tmp), int(g_tmp), int(b_tmp)); matrix.drawPixel(x_loc, y_loc_led1, color); matrix.drawPixel(x_loc, y_loc_led2, color); matrix.show(); }
With the previous neopixel version and Esp32 Core >v3 it crashed immediately after uploading,
Now with this latest neopixel update v1.12.4 and Esp32 Core v3.1.1 the code runs but the fade is no longer visible, or the dots get stuck in a certain state. Basically it seems that matrix.show() is not pushing the information like it should.
Reverted back to the ESP32 Core v2.0.17, and it works fine.