Step by step, I'm getting to whip this (personal) project into shape. I now have a (true) binary file on the SD card. The file header and data looks like this:
unsigned char version
unsigned int cols
unsigned int rows
char r
char g
char b
char r
char g
char b
ad infinitum (or till EOF is reached)
When I read that back in, I get:
1 // version
44 // cols
1
0
0
48 // rows
0
0
0
148 // r
100 // g
127 // b
144 // r
106 // g
139 // g
ad infinitum (or till EOF is reached)
My questions are:
- Is there a way to read the four lines that pertain to cols and rows respectively all in one shot? Or must I call .read() four times to get it all?
- Is there a way to read a full set of r, g, and b together as one, or must I have multiple .read() calls?
- And while I'm at it, is there a way to read 48 sets of r, g, and b together as one?
See the r,g,b values are being piped into an LED library which is updating a POV display within microseconds. So I'm trying to figure out what's the best, fastest way to get the data from the SD card. I don't know that I can read all the data into a variable without blowing up the processor (Need.More.Memor....poof) so I'm going to be reading and updating the LED string simultaneously (or as simultaneous as possible, give or take a few microseconds.)