Project in progress
MEGA BREAD - 4X4 KeyPad

MEGA BREAD - 4X4 KeyPad © LGPL

MEGA BREAD series #4, the 4 by 4 input keypad.

  • 1,605 views
  • 1 comment
  • 4 respects

Components and supplies

About this project

It will wait for input, find the input, output the input, then reset after 2 seconds. This is the test run for the programming selector for our robotics project. More to come from this entire line.

YouTube video Link <-- Watch me.

You are NOT required to build the LCD portion, the code will also output to a serial monitor. This project is being developed for a robotics base station, the keypad is to select functions and programming arguments for the robot.

Code

MEGA_BREAD_KEYPAD.inoC/C++
This short scripting links the LCD input to the keypad output, displays it, then resets after 2 seconds.
It will also output whatever input it gets to the serial monitor.
#include <LiquidCrystal.h> //Import the LCD library
#include <Keypad.h> //Import the 4 by 4 Button pad library
int delayTimeA = 500;
int delayTimeB = 2000;
int delayTimeC = 250;
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] = {38,39,40,41}; //Rows 0 to 3
byte colPins[numCols]= {A12,A13,A14,A15}; //Columns 0 to 3
//initializes an instance of the Keypad class
Keypad myKeypad= Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols);
//Setup 8-Bit mode with no PWM pinouts
LiquidCrystal lcd(28, 29, 30, 31, 32, 33, 34, 35, 36, 37);
/*Initialize the LCD and
tell it which pins are to
be used for communicating*/
void setup()
{
Serial.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
}
//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();
lcd.setCursor(0,0);
lcd.print("MEGA BREAD IS...");
lcd.setCursor(0,1);
lcd.print("Waiting on Input");
if (keypressed != NO_KEY){
  lcd.clear();
  Serial.print(keypressed);
  lcd.print("MEGA BREAD Read ");
  delay(delayTimeA); //Wait
  lcd.setCursor(0, 1);
  lcd.print ("The Input as");
  delay(delayTimeA); //Wait
  lcd.setCursor(13, 1);
  lcd.print (keypressed);
  delay(delayTimeB); //Wait
  lcd.clear();
}
}

Schematics

MEGA BREAD - keypad
YouTube video Link <-- Watch me.

You are NOT required to build the LCD portion, The Code will also output to a serial monitor.
Mega bread keypad schem uq61kgwjig
MEGA BREAD - keypad 2
-17-2016

It will wait for input, find the input, output the input, then reset after 2 seconds. This is the test run for the programming selector for our Robotics Project. More to come from this entire line.

YouTube video Link <-- Watch me.

You are NOT required to build the LCD portion, The Code will also output to a serial monitor.
Mega bread keypad schem 4tapezvrft

Comments

Author

Pigeon kicker
Pigeon-Kicker
  • 11 projects
  • 14 followers

Additional contributors

  • Layout and functionality of keys. by Mini Pigeon

Published on

April 17, 2017

Members who respect this project

MitovPigeon kicker

and 2 others

See similar projects
you might like

Similar projects you might like

Mega Bread - Hello World

Project in progress by Pigeon-Kicker

  • 997 views
  • 0 comments
  • 4 respects

Mega Bread - Atari Joystick Linking for Robotics Control

Project in progress by Pigeon-Kicker

  • 1,439 views
  • 3 comments
  • 10 respects

MEGA BREAD - Hank the HexaPod-Updated 5-31-17

Project in progress by Pigeon-Kicker

  • 1,514 views
  • 1 comment
  • 13 respects

Arduino Keyless Door Lock System with Keypad and LCD

Project tutorial by DIY Hacking

  • 15,301 views
  • 9 comments
  • 44 respects

4x4 T9 Keypad

by vicente zavala

  • 1,442 views
  • 0 comments
  • 1 respect

MEGA BREAD - Stereo Power Audio Amplifiers

Project in progress by Pigeon-Kicker

  • 1,084 views
  • 0 comments
  • 6 respects
Add projectSign up / Login