KEYPAD

TINKS043

  1. The keypad is an arrangement of 16 push button switches in the form of a 4x4 matrix.
  2. The keypad consists of numbers 0,1,2,3,4,5,6,7,8,9 and letters A, B, C, D,*, #.
  3. The column scanning method is used to identify the pressed key.
  4. It is used to provide input to microcontroller units.
Features:-
  1. Maximum Voltage across EACH SEGMENT or BUTTON: 24V.
  2. Maximum Current through EACH SEGMENT or BUTTON: 30mA.
  3. Maximum operating temperature: 0°C to + 50°C.
  4. Ultra-thin design.
  5. Adhesive backing.
  6. Easy interface.
  7. Long life.
Applications:-
  1. Security systems.
  2. Vending machines.
  3. Industrial machines.
  4. Engineering systems.
  5. Measuring instruments.
  6. Data entry for Embedded Systems
  7. Hobby projects.
  8. Basically anywhere INPUT device is needed.

    

#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the keypads
char Keys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {2,3,4,5}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {6,7,8,9}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(Keys), rowPins, colPins, ROWS, COLS);

void setup(){
Serial.begin(9600);
}

void loop(){
char customKey = customKeypad.getKey();

if (customKey){
Serial.println(customKey);
}
}