Can someone help me, please? I have an issue with Arduino R4 Minima when I want to interface the 4x4 keypad with it.
It prints ones, is not working properly.
/* @file HelloKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | Demonstrates the simplest use of the matrix Keypad library.
|| #
*/
#include <Keypad.h>
const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
{'1','2','3', 'A'},
{'4','5','6', 'B'},
{'7','8','9', 'C'},
{'*','0','#', 'D'}
};
byte rowPins[ROWS] = {9, 8, 7, 6}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {5, 4, 3, 2}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(){
Serial.begin(9600);
}
void loop(){
char key = keypad.getKey();
if (key){
Serial.println(key);
}
}
Welcome to the forum
Does it print ones whatever key you press ?
1 Like
I'm using ''hellokeypad'' example program whenever I press any key it prints out ones and a wrong key in the same time.
The Uno R4 is still very new and it may be that the Keypad library, which is very old, is not compatible with it
What baud rate have you got the Serial monitor set to ?
Obviously the first thing to do is to check your wiring. Are you using a breadboard ? If so check that the power lines along each side do not have breaks in then half way along
Have you got any other Arduino boards or can you borrow one ?
We have tested the Keypad library and we can confirm it is not compatible yet but the adafruit keypad library is.
Additionally, we have put together a list of libraries we have tested with the UNO R4 to make a map of which ones are compatible out of the box GitHub - arduino/uno-r4-library-compatibility
1 Like
Thanks @mario-r
I think that this is going to catch a lot of users out
1 Like
Thank you, sir. The wiring is good and I did not use breadboard and interface it directly with R4 M.
Thank you. Let's try with adafruit, then.
It's working just fine with adafruit library, thanks.
Thank you mario-r for this piece of advice. I've just tested Adafruit Keypad Library with Arduino R4 Wifi and it works
Should someone be interested, below:
link to adafruit learning page: https://learn.adafruit.com/matrix-keypad/arduino
link to github repository: https://github.com/adafruit/Adafruit_Keypad/blob/master/README.md
link to clear explanation of membrane keypad pinout and technical details: https://lastminuteengineers.com/arduino-keypad-tutorial/
1 Like
can you help me for the full code cause I add Adafruit keypad library and still not working.
system
Closed
February 12, 2025, 11:17am
15
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.