Project in progress

MEGA BREAD - 4X4 KeyPad © LGPL

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

  • 499 views
  • 1 comment
  • 1 respect

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.

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

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();
}
}

Comments

Author

Pigeon kicker
Pigeon-Kicker
  • 9 projects
  • 7 followers

Additional contributors

  • Layout and functionality of keys. by Mini Pigeon

Published on

April 17, 2017

Members who respect this project

MitovPigeon kicker
See similar projects
you might like

Similar projects you might like

Hacking My Toaster

Project tutorial by javier muñoz sáez

  • 461 views
  • 5 comments
  • 11 respects

Rickroll Box

Project showcase by slagestee

  • 1,454 views
  • 0 comments
  • 6 respects

Gyroscope Fun with NeoPixel Ring

Project tutorial by danionescu

  • 2,174 views
  • 0 comments
  • 8 respects

START: A STandalone ARduino Terminal

Project tutorial by Alessio Villa

  • 1,638 views
  • 0 comments
  • 6 respects

Music Reactive LED Strip

Project showcase by buzzandy

  • 543 views
  • 2 comments
  • 11 respects

Pavlov's Cat

Project tutorial by Arduino

  • 943 views
  • 0 comments
  • 2 respects
Add projectSign up / Login