Announcement

Collapse
No announcement yet.

How read and parse a string from the serial comm

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How read and parse a string from the serial comm

    Hello,
    I need to read and parse a string from the serial COMM0 like this: "M11:23,34,23,25,26,27,27,25,27,28,29,29,28,27,27,27"
    I have to save the information in an array like: var colors[16]:=[23,34,23,26,27,27,25,28,29,29,29,29,28,27,27,27];
    Then, I will paint some rectangles where their color have a relation with these values.
    How can I save the input string in a single variable?
    and
    How can I separate the values?

    I have seen the examples but are very few. Where I can find more examples?

    Thanks

  • #2
    So could this be "M12341:11123,-1234,23,25,26,27,27,25,27,28,29,29,28,27,27,27"?

    Perhaps you need to think about sending as Binary, as the parsing is easier and the data ends up less.

    There are examples of both type on the forum, perhaps try searching for parse.
    Mark

    Comment

    Working...
    X