nRF52840 DK updating WS2812B led strip?

Hi,

I have tried the led strip example program and it works. My project will use 88 WS2812B RGB LEDs. For testing I used only 5 WS812B RGB LEDs. If I want to turn on red LED alternate, the code that works is this below.

	memset(&pixels, 0x00, sizeof(pixels));
	memcpy(&pixels[0], &colors[0], sizeof(struct led_rgb));
	rc = led_strip_update_rgb(strip, pixels, STRIP_NUM_PIXELS);
	memcpy(&pixels[1], &black, sizeof(struct led_rgb));
	rc = led_strip_update_rgb(strip, pixels, STRIP_NUM_PIXELS);
	memcpy(&pixels[2], &colors[0], sizeof(struct led_rgb));	
	rc = led_strip_update_rgb(strip, pixels, STRIP_NUM_PIXELS);
	memcpy(&pixels[3], &black, sizeof(struct led_rgb));	
	rc = led_strip_update_rgb(strip, pixels, STRIP_NUM_PIXELS);	
	memcpy(&pixels[4], &colors[0], sizeof(struct led_rgb));
	rc = led_strip_update_rgb(strip, pixels, STRIP_NUM_PIXELS);

My concern is if I do it this way for 88 WS2812B RGB LEDs, there might be some delay lighting up all the LEDs. Is there a better way?

Regards,

Markel

Related