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
How can I do this but instead of 1-100kg I wanted from a-z.
This is how it would work:
Something like this:
char c = (char) round(map(sliderVal, sliderMin, sliderMax, 65, 90));
what does the round do in this case ?
and why did you use 65 to 90 for the range of letters?
And this as well, can be answered via the reference section under char()…
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)
.
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