int getFileFrames(char* file) { File f = SPIFFS.open(file, "r"); String line; int n = -1; int result; if (!f) { Serial.println("Cannot open file!"); return -1; } else { Serial.println("Reading file and trying to find frame counter..."); while(f.available() && n<0) { line = f.readStringUntil('\n'); n = line.lastIndexOf("FRAME_COUNT"); } Serial.println("Frame Counter found at this line:"); Serial.println(line); String strFrameNumber = line.substring(n+12); result = strFrameNumber.toInt(); } f.close(); return result; } void playFile(char* file, int framespeed) { int frameNumber = getFileFrames(file); int n = -1; RgbColor *anim[frameNumber][64];; //uint8_t anim[frameNumber][64*3]; File f = SPIFFS.open(file, "r"); String line; char rgbChar[8]; // load file into array if (!f) { Serial.println("Cannot open file!"); return; } else { // forward to first hex number while(f.available() && n<0) { line = f.readStringUntil('\n'); n = line.lastIndexOf("0x"); } for(int frame=0; frame>8 & 0xFF, rgb>>16); } line = f.readStringUntil('\n'); } line = f.readStringUntil('\n'); line = f.readStringUntil('\n'); } } f.close(); Serial.println(frameNumber); for(int frame=0; frame