Button Matrix Manipulation Question #8
-
|
Hello, thank you for this library. I was wondering how difficult it would be to setup the button matrix for characters instead of numbers? I am asking this so I can print out the letters on my keypad instead of its numerical representation. Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hi KyAZ73, this should be a very simple task. Just define an array of characters below the Button array declaration of the exact same size as the button array. Make sure the first button starts with index 0 and continuously counts up as given in the example below (0...8 here). and later in use the number as an index into your character array when a button is pressed ... like this I have commented out the original statements from the example so you can easily see what has changed. Of course you could as well use a string instead of a simple character array but it takes one byte more of memory for the trailing zero. |
Beta Was this translation helpful? Give feedback.
Not sure if I got you right. The example above shows if a button has been pushed down using the fell() method or has been released using rose() method. You can also you the pressed() method that repeatedly signal while a button is being pressed. The button number in the example above can be determined by the idx variable or you could also use the getNumber() method of the button to determine its number.
I strongly recommend looking at the examples includes with the library, you should find anything you need in there.
If this solves your problem, please mark the thread a solved.