Hi Guys,
I built a 10x20 LED Matrix with SK6812 RGBW LED´s and an Arduino Uno clone as controller.
First tests with several test scripts worked fine. RGBW LED Strip with generic controller (f.e. SK6812RGBW) - LEDs and Multiplexing - Arduino Forum
Fully motivated after the first success I configured Jinx! as it is done for the WS2811/12.
I found a sketch which uses FastLED to transmit the data to the LED´s:
#include <FastLED.h>
#define NUM_LEDS 200 // the last 4th didn´t light up, setting it to 267 = 200/3*4 worked
#define DATA_PIN 6
#define CMD_NEW_DATA 1
#define BAUD_RATE 500000
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2811, DATA_PIN, GRB>(leds, NUM_LEDS);
Serial.begin(BAUD_RATE);
}
int serialGlediator () {
while (!Serial.available()) {}
return Serial.read();
}
void loop() {
while (serialGlediator () != CMD_NEW_DATA) {}
Serial.readBytes((char*)leds, NUM_LEDS*3);
FastLED.show();
}
The result of the first test with Jinx! can be seen in the first attached picture. I selected the mode "Simple Color" and chose plain green.
The first pixel is in the top right corner. Leds light up in the order: red, green+white, blue+white. But the last 50 (one 4th) stay off.
So I set the Number of LEDs to 267 and all light up (picture 2) but still in the wrong colors.
My question is: How can i read the glediator protocoll (GRB) - 24 bit - and put it out as 32 bit with "0" for the white part to get the right color for every pixel?
I also found a sketch which sets a CRGBW struct in FastLED. Trying this didn´t help either:
/* FastLED_RGBW
*
* Hack to enable SK6812 RGBW strips to work with FastLED.
*
* Original code by Jim Bumgardner (http://krazydad.com).
* Modified by David Madison (http://partsnotincluded.com).
*
*/
#ifndef FastLED_RGBW_h
#define FastLED_RGBW_h
struct CRGBW {
union {
struct {
union {
uint8_t g;
uint8_t green;
};
union {
uint8_t r;
uint8_t red;
};
union {
uint8_t b;
uint8_t blue;
};
union {
uint8_t w;
uint8_t white;
};
};
uint8_t raw[4];
};
CRGBW() {}
CRGBW(uint8_t rd, uint8_t grn, uint8_t blu, uint8_t wht) {
r = rd;
g = grn;
b = blu;
w = wht;
}
inline operator = (const CRGB c) __attribute__((always_inline)) {
this->r = c.r;
this->g = c.g;
this->b = c.b;
this->white = 0;
}
};
inline uint16_t getRGBWsize(uint16_t nleds) {
uint16_t nbytes = nleds * 4;
if (nbytes % 3 > 0) return nbytes / 3 + 1;
else return nbytes / 3;
}
#endif
and the code where i tried using it:
#include <FastLED.h>
#include "FastLED_RGBW.h"
#define NUM_LEDS 200
#define NUM_LEDS_adj 267
#define DATA_PIN 6
#define CMD_NEW_DATA 1
#define BAUD_RATE 500000
// FastLED with RGBW
CRGBW leds[NUM_LEDS];
CRGB *ledsRGB = (CRGB *) &leds[0];
void setup() {
FastLED.addLeds<WS2812, DATA_PIN, RGB>(ledsRGB, NUM_LEDS_adj);
Serial.begin(BAUD_RATE);
}
int serialGlediator () {
while (!Serial.available()) {}
return Serial.read();
}
void loop() {
while (serialGlediator () != CMD_NEW_DATA) {}
Serial.readBytes((char*)leds, NUM_LEDS_adj*3);
FastLED.show();
}
I hope you can help me get the matrix going!
PS English is not my mother tongue, spelling errors can be kept.

