@UKHeliBob just did. Did you mean, "Thank you?"
And this...
You probably did not follow the sketch (also shown to be wrong above) and did something like this...
for WOKWI.COM
sketch.ino
#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] = { 5, 4, 3, 2 }; //connect to the row pinouts of the keypad
byte colPins[COLS] = { 9, 8, 7, 6 }; //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);
}
}
diagram.json
{
"version": 1,
"author": "Anonymous maker",
"editor": "wokwi",
"parts": [
{
"type": "wokwi-arduino-nano",
"id": "nano",
"top": -22,
"left": 279.7,
"rotate": 270,
"attrs": {}
},
{ "type": "wokwi-membrane-keypad", "id": "keypad1", "top": -376.4, "left": 140, "attrs": {} }
],
"connections": [
[ "nano:2", "keypad1:R4", "green", [ "h0" ] ],
[ "nano:3", "keypad1:R3", "green", [ "h0" ] ],
[ "nano:4", "keypad1:R2", "green", [ "h0" ] ],
[ "nano:5", "keypad1:R1", "green", [ "h0" ] ],
[ "nano:6", "keypad1:C4", "green", [ "h0" ] ],
[ "nano:7", "keypad1:C3", "green", [ "h0" ] ],
[ "nano:8", "keypad1:C2", "green", [ "h0" ] ],
[ "nano:9", "keypad1:C1", "green", [ "h0" ] ]
],
"dependencies": {}
}

