Interactive keyboard for a smartwatch processing

How can I do this but instead of 1-100kg I wanted from a-z.
This is how it would work:

  • when you press and start dragging the letters would change
  • when you release the mouse the letter on top of the row is the letter chosen
1 Like

Something like this:
char c = (char) round(map(sliderVal, sliderMin, sliderMax, 65, 90));

2 Likes

what does the round do in this case ?

and why did you use 65 to 90 for the range of letters?

Hello @matildespinheiro

Check out the reference section for this type of question:

:nerd_face:

2 Likes

And this as well, can be answered via the reference section under char()

:nerd_face:

2 Likes

but how would you do this for every letter ??

These are the ASCII codes for characters a-z (lowercase). The round converts the output of the map() function to an int so we can cast it to a char using (char).

2 Likes

but this is defining the letters right? how would I define the limits for each letter to appear on the screen? Thank you for your answers.

What do you mean by limits exactly? The ASCII keycodes (65 - 90) are limited by the map() function.

I did this for every letter but its not working idk why