Show Posts
Pages: 1 ... 6 7 [8]
106  Using Arduino / Programming Questions / Re: Substrings with char arrays on: July 14, 2012, 06:46:01 am
Code:
Serial.println((char *)&input_line[20]);
That did the trick.  Thanks!

Nick, I'd seen your page, and used your code for reading the line, but the discussion of state machines went a bit over my head--I'm still pretty green to Arduino (and to C-like languages).
107  Using Arduino / Programming Questions / Substrings with char arrays on: July 13, 2012, 09:00:52 pm
I'm working on a project to read CSV data over a serial connection, reformat the first field to a human-readable date, and write the resulting data to an SD card.  The lines of data can be up to around 150 characters long, so they're read into char input_line [160].

By stepping through input_line, I can find the first comma, and then do my conversion on the contents of the first field, storing the result in char dataTimeString [20].  Once I've done that, I need to print out the rest of input_line, from the first comma to the end of the line.

So, with apologies for the simple question, how do I do that?  I see documentation on the String class, but I understand that is a bit of a resource hog, which is why I'm using the char arrays.  I'm sure there's a simple function to do this, but I'm not sure where else to look to find it.
Pages: 1 ... 6 7 [8]