Suggestion to add chr() function to UI Flow
-
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. -
Hello @Paulskpt
some functionality which is not directly available as block can still be used via the
Execute codeblock from theAdvancedsection. I've just tried that andchr()can be used that way.Thanks
Felix -
@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.
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