Any C function, such as scanf(), can be called from an Arduino program.
scanf() is NOT limited to white spaces as delimiters.
Before we can help you choose/write this mysterious function, seeing an example of the input, and the desired output, would be essential.
Thank you both for the replies. PaulS i do know scanf can be used in python i’m just wondering how you designate the delimiter for a different character. I certainly don’t want you to write a function for me, i just want to know how to use scanf, generically, to use *any character as a delimiter. I’m not trying to be stupid or short or anything, i just want to take a crack at writing the function without help first… once i know how to use scanf correctly that is. Its just the best way for me build and learn at this point. I can definitely give you examples of the buffers and the intended output or capture.
Using a Fona 2g device, I have a buffer for incoming serial from the Fona named replybuffer.
When i query the gps, i get raw nema output in the buffer.
Data stream: <— +CGNSINF: 0,4043.576433,7400.316980,58.647405,20150601201258.000,64,12,0.548363,100.442406
Not entirely sure if the <— +CGNSINF: comes across with the stream or not, but i believe it does since its function code basically does a println of ‘gpsdata’ which gets called up three lines earlier like this:
fona.getGPS(0, gpsdata, 120);
Now i’m a noob, but i’m sure we can get rid of the '<— +CGNSINF: ’ by just calling the output into another array ignoring those first few bits? Then use scanf however using “,” as the separator.