Detecting Sub-strings in ASCII Text
Frank
Posts: 3
Hi. Just got the stamp yesterday. The project I am working on is reading an ascii string and if certain sub-strings are found certain actions will occur. Its been 20 years since I worked with basic so I am rather rusty. The actual project is to read the codes of an EAS (weather alert) and decide if functions other than the ones the endec supports will occur. Any help ? Thanks 73 Frank
Post Edited By Moderator (Jon Williams) : 12/21/2004 3:58:39 PM GMT
Post Edited By Moderator (Jon Williams) : 12/21/2004 3:58:39 PM GMT
Comments
Rick
Just a quick critique....be sure, when you post, that you use a proper subject header.· Lots of people use the forums and are picky about what they view.· "Hello" doesn't lead them to be curious enough to see what it's about....I'm more nosey than curious! haha
Anyhow, in the manual there are some examples of the SERIN command.
Here's a quick usage:
SERIN commin, n19k2, [noparse][[/noparse]data]
Now, you have to set up your constants and variables at the beggining of you program.
commin PIN 0
n19k2 con 110
data var word
So you have the SERIN command followed by the pin you want the data to come in on, then you need to tell it how fast to expect it, and finally, where to put it.
This is the simplest way to use SERIN....there are other flow pins and timeout functions...but this is what you need for babysteps!
So, if I were to rewrite my program without the constants, it would be:
SERIN 0, 110, [noparse][[/noparse]data]
you still have to have a variable declared in order to store your incoming data.·
Read the help file in PBasic and you can make leaps and bounds...as well as all the educational material on the Parallax website (What's a Microcontroller" comes to mind.)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://members.rogers.com/steve.brady
http://www.geocities.com/paulsopenstage
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
just a quick note....
the code I threw on there was using a BS2P...so a BS2 would require different baud numbers....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://members.rogers.com/steve.brady
http://www.geocities.com/paulsopenstage
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."