xl97:
anyways.. maybe to get rid of the overhead of accessing the SD card..reading, parsing date.....etc..maybe read in a 'few' line/variables at a time.. maybe the first 10 to give you a bit of a 'buffer' for smoother/continuous movement..?
Where would you be reading those 'few' lines/variables at a time from? Thin air? They're coming off of the SD card.
PaulS:
How many records will there be?You can't alter how the SD read is done. It will read 512 byte chunks from the file, or less if there is not that much data. If all the values are byte sized, you could create a binary file, with 5 bytes per record (no cr/lf needed). That would allow for 102 records before another disk read is performed.
The proper thing to do,though is perform a timing test. See if the read will be fast enough.
How many records, not entirely sure yet. It's a 6 minute show, and the servos will be doing "stuff" the whole time. At the most, they'll be receiving a new instruction every second. For the moment, the instruction that needs to get parsed is what I've shown above, 5 parameters per record. Two of them will have a number between 0 and 180, two of them will have a number between 0 and 10, and the last one is 0 to 30 ... maybe larger, but no more than 3 digits.
Can I fit it all in 512 bytes? Just a random set of instructions, sending both servos into sweep mode and changing every 2-5 seconds, and I can get about 35 instructions, one per line (cr/lf at the end), in a TEXT file. I want to stay away from having to create a binary file. The idea is that anyone can enter their instructions in an Excel file and export the sheet as a CSV file.
I'm going to need more than 35 instructions, that's for sure. ![]()