In short:
As soon as #define NUM_LEDS is greater than 50, nothing works anymore.
In detail:
#include <Adafruit_SSD1306.h>
and
#include <FastLED.h>
do not work well together ![]()
It does not appear as a memory issue.
„Sketch uses 17622 bytes (54%) of program storage space. Maximum is 32256 bytes.
Global variables use 1034 bytes (50%) of dynamic memory, leaving 1014 bytes for local variables. Maximum is 2048 bytes.“
I have a LED strip with 144 LEDs (I'll use around 70) and an OLED SSD1306 128x64 connected to Arduino UNO.
OLED specs = 0.96" I2C IIC Serial 128X64 White OLED LCD.
If I run only the LED code, commenting the OLED part, the LEDs are working fine.
If I run only the OLED code, commenting the LED part, the OLED is working fine.
But as soon as I run the FastLED with the OLED code (no matter what the OLED show display, a text or a bitmap), then nothing works anymore.
No code error, just the OLED does not display anything anymore, nor any LED is working.
No matter where I place
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS)
in my setup(), as soon as the FastLED line is uncommented, nothing worked anymore.
After spending hours on it, I found out that the amount of LEDs (NUM_LEDS) is the issue:
#define NUM_LEDS 50
works fine, while any amount greater than 50 won't. So 50 seems to be the limit.
I can’t explain why and most of all I need a solution cause I need to work with more than 50 LEDs.
Do you think I should buy an OLED using SPI instead of I2C?
Or any advice on a different library than the Adafruit one which would work?
Any advice very much appreciated as I'm stucked.
The source code is here:
And there's a Bitmap.h also with my logo. Not useful here as not related to the issue.