// https://wokwi.com/projects/419438907998692353
# include <Key.h>
# include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 4;
char keyMatrix[ROWS][COLS] = {
{'A', 'B', 'C', 'D'},
{'E', 'F', 'G', 'H'},
{'J', 'I', 'K', 'L'},
{'M', 'N', 'O', 'P'},
};
byte rowPins[ROWS] = {46, 47, 48, 49};
byte colPins[COLS] = {50, 51, 52, 53};
Keypad myKeypad = Keypad(makeKeymap(keyMatrix), rowPins, colPins, ROWS, COLS);
void setup() {
Serial.begin(9600);
Serial.println("\nJello Whirled!\n");
DDRF = 0xf0;
}
void loop() {
char theKeyPress = myKeypad.getKey();
if (theKeyPress) {
Serial.println(theKeyPress);
PORTF &= 0xf0;
PORTF |= theKeyPress - 'A';
}
}