Hi there,
I want to reading binary RGB data from SD card into a Fastled array to display animated images on a 16x16 WS2812B LED Matrix. I found some code that does exactly that but I am not sure how it acutally works:
file.open(fileName, O_READ);
for (int i = 0 ; i < (file.fileSize()/(NUM_LEDS*3)); i++)
{
file.read( (uint8_t*)leds,NUM_LEDS*3 );
FastLED.show();
delay(speed); // delay between each frame
}
file.close();
This code irritates me a bit. Could someone please explain how this works? The file.read line should read the binary data into a variable, but there is no variable assignment on the left side of file.read. The next line calls FastLED.show() and - voila - for some magic reason all the data read from SD card is already shown by the LED matrix. But how does this work? Where exactly is the data read into the FastLED array here? And where could I hook into if I would like to process each of the read-in rgb colors (f.e. change its saturation etc.)? ![]()