🤖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

    Scheduled Pinned Locked Moved UIFlow
    3 Posts 2 Posters 3.3k Views
    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 Offline
      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 Offline
        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 Offline
          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

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post