OctoWS2011 + Teensy3.5 Stop flicker

Status
Not open for further replies.

Antonio

New member
Hi!
I'm been working (several days), trying to avoid the flickering in a led strip with WS2812b (300 independent leds) and a Teensy 3.5..... and the result:

After make a lots of combinations of different resistors values (from 47 to 1K Ohms) after and before the 74HCT245 buffer and/or adding capacitor parallel to the power-source......... no not work, the flickering still make me headache.

I'm just using the more simple example provide in the library ( , reading the code of OctoWS2011, and adding little-little delay between OctoWS2011.show(), the flicker gone. It's gives me the idea to make a check if the library is in render process, and wait it to finish and then, call the show() function.



Code:
void colorWipe(int color)
{
	for (int i = 0; i < ledsPerStrip; i++) {
		leds.setPixel(i, color);
		[B]while (!leds.busy());[/B]
		leds.show();
		}
}




The full code:


Code:
#include <OctoWS2811\OctoWS2811.h>
#include "WProgram.h"

#define RED    0x160000
#define GREEN  0x001600
#define BLUE   0x000016
#define YELLOW 0x101400
#define PINK   0x120009
#define ORANGE 0x100400
#define WHITE  0x101010

const int ledsPerStrip = 300;

DMAMEM int displayMemory[ledsPerStrip * 6];
int drawingMemory[ledsPerStrip * 6];

const int config = WS2811_GRB | WS2811_800kHz;

OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);

void setup() {
	leds.begin();
	leds.show();
	Serial.begin(115200);
}

void loop() {
	uint32_t enlapse_time;
	uint32_t starttime = micros();
	int fullRender = 0;
	float fps;

	colorWipe(RED);		fullRender++;
	colorWipe(GREEN);	fullRender++;
	colorWipe(BLUE);	fullRender++;
	colorWipe(YELLOW);	fullRender++;
	colorWipe(PINK);	fullRender++;
	colorWipe(ORANGE);	fullRender++;
	colorWipe(WHITE);	fullRender++;

	enlapse_time = micros() - starttime;
	// average time showing ledsPerStrip leds.
	fps = (fullRender * ledsPerStrip) / (enlapse_time / 1.0E6);
	Serial.print("FPS:");
	Serial.print(fps);
	Serial.print("\n");
}

void colorWipe(int color)
{
	for (int i = 0; i < ledsPerStrip; i++) {
		leds.setPixel(i, color);
		while (!leds.busy());
		leds.show();
		}
}
 
Status
Not open for further replies.
Back
Top