This library was made in order to solve a simple problem - traversing the contents of a String in a CSV format (or similar) - with few lines of code in an environment where every byte of memory matters, Arduino.
Coming from Java programming I remembered of the useful class Scanner, which offered pretty good functionalities in analyzing CSV inputs, so I decided to replicate that mechanism.
The basic usage is pretty simple, the basic functions you need are
The first one tells you if there is another element ready to be read, and the second one returns that element and proceeds to analyse the next one (if it exists).
String myString = "element1;element2;element3";
StrScanner scanner(myString, ";");
If you need the result in other forms, you can call the other variants
- nextInt, that returns an integer
- nextBool, a boolean
If you want more, the complete documentation can be found in the StrScanner Wiki pages, along with a lot of sample codes and usage suggestions.
Current library version is: 0-BETA
You can download the library here, or if you wish to contribute, the repository on Bitbucket is open at this address: https://bitbucket.org/lucamcgyver/arduino-strscanner.