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

    Suggestion to add chr() function to UI Flow

    UIFlow
    2
    3
    2.8k
    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.
    • PaulskptP
      Paulskpt
      last edited by

      Hi, I am new to M5Stack. I just began experimenting with a Core2 (fw V1.9.3). Via I2C/Grove connected a M5Stack CardKB. Reading keypresses from the CardKB go OK. But I want to print their ASCII equivalent to the Core2 display. In Python one would use the function chr(int_value) but this does not exist (as far as my experience goes). An altertive I tried with success is create a lookup Dictionary (called Maps in UI Flow) but one has to create a relatively large Map to cover all the key values and their respective ASCII values (between 32 and 127). If we compare this with a simple instruction chr() the difference is big. The size of the script could be much more short.
      That is why I post here this suggestion for the maintainers of the UI Flow IDE to add in the TEXT secition a block similar to "convert to str" a "convert int to ascii", "convert with chr()" or any other suitable phrase.

      Coding keeps your mind going

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hello @Paulskpt

        some functionality which is not directly available as block can still be used via the Execute code block from the Advanced section. I've just tried that and chr() can be used that way.

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        PaulskptP 1 Reply Last reply Reply Quote 0
        • PaulskptP
          Paulskpt @felmue
          last edited by

          @felmue thank you very much. I go to try that. In the mean time I discovered that the function cardkb_getstring covers more or less what I wanted to achieve.

          Coding keeps your mind going

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