Best way to retrieve settings from an SD CSV?
![userHead](https://dfimg.dfrobot.com/dfPortrait2.png)
Hey everyone,
I am working on a project, and part of it involves having the user change settings in a CSV file on an SD card, that the arduino then reads. I've got the SD reader set up and connected using the Arduino library, but my issue now is how I actually isolate each setting. The file is set up as:
(setting name), (setting value)
Setting 1, 0
Setting 2, 100
Setting 3, 1
Etc.
All of the settings are an integer.
I'm trying to find how to get each of those settings into my code to reference. My current thought is to read through the entire file, and any time a comma is found, record the byte after it as that setting, and move on until the right number of commas have been found. Is there any better way of doing this? I'm also already running low in dynamic memory with everything else I need to do, so the lower memory usage of the solution, the better.
I am working on a project, and part of it involves having the user change settings in a CSV file on an SD card, that the arduino then reads. I've got the SD reader set up and connected using the Arduino library, but my issue now is how I actually isolate each setting. The file is set up as:
(setting name), (setting value)
Setting 1, 0
Setting 2, 100
Setting 3, 1
Etc.
All of the settings are an integer.
I'm trying to find how to get each of those settings into my code to reference. My current thought is to read through the entire file, and any time a comma is found, record the byte after it as that setting, and move on until the right number of commas have been found. Is there any better way of doing this? I'm also already running low in dynamic memory with everything else I need to do, so the lower memory usage of the solution, the better.