🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Bug in Micropython. '#' causes Syntax error on Core

    Micropython
    1
    1
    2.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      robjasey
      last edited by

      Version v1.9.8 Core

      The following code will cause a syntax error when run

      x = "#"
      print(x)

      I guess the interpreter thinks the # string is the start of a comment.

      Why did I need this? I am trying to send the GRBL command "$#" to the GRBL stepmotor module. (which is one of the commands it accepts).

      Workaround

      x=b'\x23'.decode()
      grbl.g_code('$'+x)

      1 Reply Last reply Reply Quote 0
      • First post
        Last post