4x4 Matrix Keyboard Keypad [S188]




https://www.youtube.com/watch?v=YU6Nc10mqug


*GitHubhttps://github.com/rdiot/rdiot-s188.git


* Specs

Small and compact in size

MR-MINI-4x4KEY is a 4x4 matrix keyboard module. It has 8 pins and 10 number 4 Letters on the interface

8-PIN MRconnect hole

+3.0V to +5VDC supply voltage

On-board pulled-up resistors

Four mounting holes on each corner

Dimension:7cm*6.5cm*0.5cm( approx)


* Contents

byte colPins[numRows] = {2,3,4,5}; //col 0 to 3

byte rowPins[numCols]= {6,7,8,9}; //row 0 to 3


- Connect

1(LEFT) ----- D2

2 ----- D3

3 ----- D4

4 ----- D5

5 ----- D6

6 ----- D7

7 ----- D8

8(RIGHT) ----- D9


- Key Code

const byte numRows= 4; //number of rows on the keypad

const byte numCols= 4; //number of columns on the keypad

 

//keymap defines the key pressed according to the row and columns just as appears on the keypad

char keymap[numRows][numCols]= 

{

  {'1','2','3','A'},

  {'4','5','6','B'},

  {'7','8','9','C'},

  {'*','0','#','D'}

};

 

byte colPins[numRows] = {2,3,4,5}; //col 0 to 3

byte rowPins[numCols]= {6,7,8,9}; //row 0 to 3


  char keypressed = myKeypad.getKey();

    switch (keypressed)

    {

      case '1':        

    lcd.print("keypressed=" + (String)keypressed + "  ");

      break;

    }

Posted by RDIoT
|