Serial Commands
Shining Ivy
Posts: 5
Hello,
I have been working on a project and I would like to know how I can pass a text command through the serial terminal to cause something to happen. Right now the project is setup to receive certain number values to setup certain parameters, But I would like to have a parameter list that I could call by entering a text command like "Shiitake"
Is there a method in the Full_duplex_serial_plus object that can do this?
Thank You,
Jesse
I have been working on a project and I would like to know how I can pass a text command through the serial terminal to cause something to happen. Right now the project is setup to receive certain number values to setup certain parameters, But I would like to have a parameter list that I could call by entering a text command like "Shiitake"
Is there a method in the Full_duplex_serial_plus object that can do this?
Thank You,
Jesse
Comments
http://forums.parallax.com/forums/default.aspx?f=25&m=431357
Have a nice day
In the evening I can provide some code as well. In my CogOS I also have a command line interface. It already includes a parser which allows to enter a command plus any number (up to a limit ;o) of strings, decimal, hexadecimal or binary numbers which then can be easily used by the code executing the commands.
Key in both implementations (as far as I remember Mikes) is that the command is converted to a hash-value. This makes it easier and faster to decide which code to run because no string-compares are needed and branching is simply done in a case statement.
·