Shop OBEX P1 Docs P2 Docs Learn Events
Serial Commands — Parallax Forums

Serial Commands

Shining IvyShining Ivy Posts: 5
edited 2010-03-12 10:40 in Propeller 1
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

Comments

  • karakikokarakiko Posts: 11
    edited 2010-03-12 09:44
  • MagIO2MagIO2 Posts: 2,243
    edited 2010-03-12 10:40
    Have a look at http://obex.parallax.com/objects/28/·written by Mike Green. As far as I remember it works with keyboard and TV or VGA, but these can easily be replaced.

    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.

    ·
Sign In or Register to comment.