Your code could stick incoming serial data into an array until it gets a carriage return, recognize the header to ID the line, then split it at the commas, and finally decode the values between the commas. You get the occasional garble, but it resets at every sentence. You can then use the GPS NMEA string reading code from the examples with some modifications. ![]() My values uses three bytes and only one sentence structure, but in your case a comma every two or four bytes makes more sense, with perhaps a different sentence header for each line of the matrix? I start a sentence with a special character, say '$', then two-three characters describing the sentence structure if there are several possibilities, then a series of values separated by commas, and stop a sentence with a carriage return. I've just never tried it quite that fast (more like 9 bytes 5 times a second). ![]() This may be a stupid suggestion, but I've had good results taking a leaf from GPS NMEA strings.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |