Skip to content

The library does not work on the Arduino UNO R4 Wi-Fi. #57

Description

@Dominguserr

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);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions