Okay, I brought this home, tweaked it with a different programmer and when I try to compile it, it says it is unable to "fit variables". I'm think this will work as it stands, but you may find some errors on my part.
In any event, this waits for serial data and once received looks at the first two characters to be sure the string is what you expect it to be. You can take this out if your serial input changes every time (the first two and last two characters in a string). If you ever expect more than 40 bytes on a single serial string be sure to change that in the variable definitions.
The branch command really comes in handy for looking at a single character at a specific location in the string and doing different things instead of using the if command.
Take a look at this and see if it helps. Feel free to ask questions.
-Tony




Bookmarks