Thanks Charles,
Would you happen to have a schematic to go with this? Looks like it would make a good article for the projects section.
Thanks Charles,
Would you happen to have a schematic to go with this? Looks like it would make a good article for the projects section.
Dave
Always wear safety glasses while programming.
Not really. It does run on hardware, of course, but that hardware is really proprietary. But no hardware is needed for this. It will run on your PICDem board.
This example is actually 3 parts in one.
Part number 1 (GetCharInput) is a routine that allows you to type and send text to the PIC. It echoes back valid characters, and lets you backspace if you make an error. It "rubs out" the backspace(d) characters, and it terminates when you hit <ENTER> or <ESC>. If you hit <ENTER> it returns the input in an array. If you hit <ESC> it wipes out the array and returns. If you do nothing for 9 seconds, it returns with an empty string.
Part number 2 (ConvertToUpper) takes the input in mixed-case and converts all the alpha characters to upper case. It leaves numbers and punctuation "as-is". This is handy when you do compares, since people may or may not capitalize the right letters when they type something in.
Part number 3 (ParseIt) takes the array and searches for any number of strings. When it finds a match, it returns a number that indicates which of the strings matched. This is really useful if you get random data from something like a GPS receiver, or from a network port - or anything.
I figured that lots of people use things like this (or maybe I'm the only one). At any rate, I use similar routines a lot. They are modified to protect the innocent, and the copyright property of the company I work for.
Charles Linquist
Thanks for sharing "Master" Charles, this code is very useful indeed, in fact should be great to see this sort of capabilities bundled with PBP.
I'll try it in the first chance...
Regards!
My English doesn't sucks, it's just fugly...
Bookmarks