Hello!
I was trying out the new matrix keypad I bought. I wrote a code that spits out the button that's pressed in the serial monitor, and to my suprise, it did not work propperly. It kept spaming random buttons. I had no idea as to why that is, so I asked Gemini, and got my answer - the problem lies in the fact that the library is not compatable with the Arduino UNO R4 Wi-Fi. So, I was wondering if @Chris--A or anyone else in the community could maybe update the library to support R4 boards as well? Now of course, I could do this myself, but I'm a beginner (so I just expect it to work 😉), and I definitely do not know how to do that. I'd really appreceate if someone did that!
#include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 3;
byte rowPins[ROWS] = {2, 3, 4, 5};
byte colPins[COLS] = {6, 7, 8};
char keys[ROWS][COLS] = {
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'}
};
Keypad numBoard = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
void setup() {
Serial.begin(9600);
}
void loop() {
char pressedKey = numBoard.getKey();
if(pressedKey) {
Serial.println(pressedKey);
}
}
Hello!
I was trying out the new matrix keypad I bought. I wrote a code that spits out the button that's pressed in the serial monitor, and to my suprise, it did not work propperly. It kept spaming random buttons. I had no idea as to why that is, so I asked Gemini, and got my answer - the problem lies in the fact that the library is not compatable with the Arduino UNO R4 Wi-Fi. So, I was wondering if @Chris--A or anyone else in the community could maybe update the library to support R4 boards as well? Now of course, I could do this myself, but I'm a beginner (so I just expect it to work 😉), and I definitely do not know how to do that. I'd really appreceate if someone did that!
#include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 3;
byte rowPins[ROWS] = {2, 3, 4, 5};
byte colPins[COLS] = {6, 7, 8};
char keys[ROWS][COLS] = {
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'}
};
Keypad numBoard = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS);
void setup() {
Serial.begin(9600);
}
void loop() {
char pressedKey = numBoard.getKey();
if(pressedKey) {
Serial.println(pressedKey);
}
}