Hi,
I am just starting a project that is using LED sheets... they are essentially an LED strip zig-zagged. The difference is that each RGB "LED" is actually 3 White LEDs. The strip has TM1812 controls but using the OctoWS2811 works just fine. The final project will have 16 sheets each with 96 "LEDs" - or should I say 288 white LEDs for me to address individually. I am experimentation with one sheet to start with and controlling the individual LEDs exactly as I want is not a problem. Well it wasn't until I tried using Threading. Even if I just add #include "TeensyThreads.h" a function that fades a bunch of LED up and down causes random flashing of other LEDs not in the set being faded.
Is it possible that there is just an incompatibility between the OctoWS2811 board and library and Threading, or is there any tweaks I cam make to stop the problem?
A very simple example of a sketch that demos the problem is below. In an effort to minimize the complexity just to show the problem at its bare bones I even stripped out the fading. With the sketch all is fine with the threading disabled, but once it is enabled the random flashing occurs. The for loop is just to simulate the changing of the brightness values for the LEDs so fading them.
Any suggestions very much appreciated.
//#include "TeensyThreads.h"
#include <OctoWS2811.h>
const int ledsPerStrip = 88;
DMAMEM int displayMemory[ledsPerStrip * 6];
int drawingMemory[ledsPerStrip * 6];
const int config = WS2811_RGB | WS2811_800kHz;
OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);
void setup() {
leds.begin();
}
void loop() {
// put your main code here, to run repeatedly:
LightTheLEDs();
delay(5000);
}
void LightTheLEDs()
{
for (int i = 0; i < 100; i++)
{
leds.setPixel(14, 0, 40, 40);
leds.setPixel(15, 40, 40, 0);
leds.setPixel(16, 0, 40, 0);
leds.setPixel(17, 0, 0, 40);
leds.setPixel(30, 40, 0, 0);
leds.setPixel(31, 0, 40, 0);
leds.setPixel(32, 0, 40, 0);
leds.setPixel(33, 0, 0, 40);
leds.show();
delay(40);
}
}
I am just starting a project that is using LED sheets... they are essentially an LED strip zig-zagged. The difference is that each RGB "LED" is actually 3 White LEDs. The strip has TM1812 controls but using the OctoWS2811 works just fine. The final project will have 16 sheets each with 96 "LEDs" - or should I say 288 white LEDs for me to address individually. I am experimentation with one sheet to start with and controlling the individual LEDs exactly as I want is not a problem. Well it wasn't until I tried using Threading. Even if I just add #include "TeensyThreads.h" a function that fades a bunch of LED up and down causes random flashing of other LEDs not in the set being faded.
Is it possible that there is just an incompatibility between the OctoWS2811 board and library and Threading, or is there any tweaks I cam make to stop the problem?
A very simple example of a sketch that demos the problem is below. In an effort to minimize the complexity just to show the problem at its bare bones I even stripped out the fading. With the sketch all is fine with the threading disabled, but once it is enabled the random flashing occurs. The for loop is just to simulate the changing of the brightness values for the LEDs so fading them.
Any suggestions very much appreciated.
//#include "TeensyThreads.h"
#include <OctoWS2811.h>
const int ledsPerStrip = 88;
DMAMEM int displayMemory[ledsPerStrip * 6];
int drawingMemory[ledsPerStrip * 6];
const int config = WS2811_RGB | WS2811_800kHz;
OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);
void setup() {
leds.begin();
}
void loop() {
// put your main code here, to run repeatedly:
LightTheLEDs();
delay(5000);
}
void LightTheLEDs()
{
for (int i = 0; i < 100; i++)
{
leds.setPixel(14, 0, 40, 40);
leds.setPixel(15, 40, 40, 0);
leds.setPixel(16, 0, 40, 0);
leds.setPixel(17, 0, 0, 40);
leds.setPixel(30, 40, 0, 0);
leds.setPixel(31, 0, 40, 0);
leds.setPixel(32, 0, 40, 0);
leds.setPixel(33, 0, 0, 40);
leds.show();
delay(40);
}
}