Description
This high quality 4Γ3 Keypad Matrix lets you quickly add controls to your electronics projects. It offers 0-9 numerals, standard star(*) and hash(#) symbols.
Features:
- 100% brand new and high quality.
- 12 Button Matrix 0-9 # *
- Excellent price-performance ratio Easy communication with any microcontroller
Getting started with the 16 4 x 3 Matrix Array 12 Keys 4*3 Switch Keypad Keyboard Module.
Step1: Hardware required
Step2: Connecting the Hardware
If you want to test your Keypad this resistor is not necessary.
Step3: Upload the Code
#include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 3;
char hexaKeys[ROWS][COLS] = {
{β1β, β2β, β3β},
{β4β, β5β, β6β},
{β7β, β8β, β9β},
{β*β, β0β, β#β}
};
byte rowPins[ROWS] = {8, 7, 6, 5};
byte colPins[COLS] = {4, 3, 2};
Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
void setup(){
Serial.begin(9600);
}
void loop(){
char customKey = customKeypad.getKey();
if (customKey){
Serial.println(customKey);
}
}
NOTE: If you get stray error the problem is with your β β and β characters .Replace them with ordinary quotes β andβ. And you should be fine.