Comments

3 comments

  • Jeremy Wood

    There are a couple of different ways to send control characters over UART.

    One option: Send explicit bytes as a hex string:

    # Send Escape character (ASCII 0x27)
    - uartcmd: uart UART0
    send: hex "27"

    The "hex" keyword allows you to send bytes from a hex string. (Note: this feature was added in PLT-OS 1.9.12, make sure your project is set to >= 1.9.12).

    Another option: Use the appropriate escape sequence:

    - uartcmd: uart UART0
    send: "\x27"

    There are some limitations to what characters can be sent this way, but it works in most common cases, and it's useful when you want to intersperse plain text and control characters.

    0
    Comment actions Permalink
  • Nick Vandehey

    after trying, I couldn't make 27 work but 1B did

     

    - uartcmd: uart UART0
    send: hex "1B"
    0
    Comment actions Permalink
  • Jeremy Wood

    My mistake, when I looked up the value for ESC, I didn't realize I found the decimal value, not hex. 0x1B is equal to 27 in decimal.

    0
    Comment actions Permalink

Please sign in to leave a comment.