I am trying to read text files stored in a micro SD card. The text file is written with 60 rows and 60 values in each row with spaces. I have attached the file.
The file is about 16Kb in size and it is taking me about 700 ms-1 second to read this file. I have seen in other forum topics that the speed should be around 250 Kb/sec. My speed seems to be way too slow, am I doing something wrong or is there some inherent problem with reading files?
Well, whether this is 'slow' or not depends mainly on what you are comparing it with.
The SD.read() does read a single character at a time although not directly from the SD card file each time we would hope, but from a buffer either in the SD hardware or within the Arduino code.
But your code example (95% of which was commented out!) is doing a standard file open, read until end, file close so it won't get any faster than that.
Perhaps your hardware (SD card reader) is 'slow', or the SD card itself is poor at reading speeds. Try a different SD card, would be my (initial) advice.
Finally, try placing a much bigger file on the SD card (eg from your PC) then read that - it will average out the reading speed better so if you have a 10Mb file, does that still only give you 16k/sec reading speed?