Loading... Please wait...

Arduino Keypad Matrix 4x4

Hover over image to zoom

  • Image 1
  • Image 2
  • Image 3
  • Image 4
$0.83
SKU:
KEYBRD-01
Weight:
6.00 Grams
Availability:
Ships within 24 hours from Cleveland, Ohio.
Shipping:
Calculated at checkout

 Product Description

Adding a Arduino Keypad Matrix to your project is a quick and easy way to type in some numbers. As your projects get more sophisticated you may want to intergrate passwords into your projects so only certain users can turn thing on and off via your Arduino. The keypad has 16 buttons, arranged in a 4X4 grid and is made of a thin, flexible membrane material with an adhesive backing so you can attach it to nearly anything. The keys are connected into a matrix, so you only need 8 microcontroller pins (4-columns and 4-rows) to scan through the pad. Under each key, vertical and horizontal wires cross. When you press a key, it connects the wires at each crossing. 

  DIMENSIONS:

  • Keypad: 77mm X 69mm X 1mm
  • Length of cable + connector: 87 mm
  • 8 pin 0.1" pitch connector (breadboard-friendly)

Arduino Keypad Matrix 4x4 Code

//Arduino Keypad Matrix 4x4 Code
This code prints the key pressed on the keypad to the serial port.
Connect KeyPad Pin P1 To Arduino Digital Pin D9 : P2 To D8 : P3 To D7 : P4 To D6 : P5 To D5 : P6 To D4 : P7 To D3 : P8 To D2
www.ResistorPark.com
//

#include <Keypad.h>

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'}
};

//Code that shows the the keypad connections to the arduino terminals

byte rowPins[numRows] = {9, 8, 7, 6}; //Rows 0 to 3
byte colPins[numCols] = {5, 4, 3, 2}; //Columns 0 to 3

//initializes an instance of the Keypad class

Keypad myKeypad = Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols);

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

//If key is pressed, this key is stored in 'keypressed' variable
//If key is not equal to 'NO_KEY', then this key is printed out
//if count=17, then count is reset back to 0 (this means no key is pressed during the whole keypad scan process

void loop()
{
  char keypressed = myKeypad.getKey();
  if (keypressed != NO_KEY)
  {
    Serial.print(keypressed);
  }
}


 Find Similar Products by Category

Vendors Other Products

You Recently Viewed...

newsletter

Copyright 2017 Resistor Park. All Rights Reserved.
Sitemap | BigCommerce Premium Themes by PSDCenter

Click the button below to add the Arduino Keypad Matrix 4x4 to your wish list.