michalmonday / CSV-Parser-for-Arduino

It turns CSV string into an associative array (like dict in python)
MIT License
57 stars 12 forks source link

Two requests #7

Closed wbadry closed 3 years ago

wbadry commented 3 years ago

Hello, The parser looks great and in a very structured coding.

My two requests, if possible:

Thank you so much.

michalmonday commented 3 years ago

Hello, thank you for suggestions but I think that both are somewhat implemented already. cp.print() method has a "Stream" parameter of which default value is "Serial", so if anyone would like to provide different Serial object, it could be done like:

cp.print(Serial2);

Because it's declared like: image

Regarding the configurable pins of SD card, if you take a look at the reading_from_SD_card example, the CSV-Parser library itself does not initialize the SD card, it has to be initialized/configured externally (by calling "SD.begin(chip_select_pin)"). CSV-Parser only calls "SD.open()" (inside the "cp.readSDfile()" method) and then operates on "File" object (calling File.available, File.read and File.close methods).

So as long as the SD library allows to configure pins, the CSV-Parser will not interfere with it.

From what I see, customisation of pins for ESP32 takes place within the "SD.begin" method, so I guess it should work fine.

wbadry commented 3 years ago

Thank you so much, @michalmonday, for your prompt response. This is fantastic indeed.