currentColor = fxdata.readBytes((char*)leds, NUM_LEDS*3); //attempt to store SD card read data as RGB
I do not know your library, but I would expect a readBytes() call like this to actually store the data you want into leds
, and returning how many bytes it was able to read.
result = fxdata.readBytes((char*)leds, NUM_LEDS*3); //attempt to store SD card read data as RGB
if (result != (NUM_LEDS*3))
{
/* Handle the error here.. an action can be fill inn default values in leds[] if SD card is not working
}
/* from this point, use leds[], not currentColor */
revised example (not compile tested, lacking environment used, datatype of CRGB unknown):
void sendDMX(int theStrip, CRGB *theColor) {
for(int z=0; z<3; z++) {
DmxSimple.write((theStrip + z), theColor[z]); //DMX Channel, PWM Value
}
}
void loop()
{
fxdata = SD.open("TCL_DMX.dat"); // read only
if (fxdata)
{
Serial.println("file open ok");
}
while (fxdata.available())
{
fxdata.readBytes(leds, sizeof (leds)); //attempt to store SD card read data as RGB
Serial.println(fxdata);
sendDMX(1, leds); //RGB Strip #, RGB bytes from SD .dat file
FastLED.show();
delay(500);
}
// close the file in order to prevent hanging IO or similar throughout time
fxdata.close();
}