Embedded Programming and Robotics Lesson 9 Keypad and LCD Display 1.

Slides:



Advertisements
Similar presentations
ARDUINO FRAMEWORK.
Advertisements

Chung-Ta King National Tsing Hua University
kashanu.ac.ir Microprocessors 6-1 I/O Devices Switches, LED, LCD Lec note 6.
Input/Output (I/O) Ports and Interfacing
Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
Bits and Bytes + Controlling 8 LED with 3 Pins Binary Counting and Shift Registers.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
Other I/O LCD display Flash ROM Keyboard (PS/2) UART connectors.
Embedded Systems 7763B Mt Druitt College of TAFE Electrical Engineering Lesson 2 LCD Display Interfacing.
Embedded Programming and Robotics
Embedded Programming and Robotics Lesson 1 Basic Electricity and Electronics Transistor Basics Lesson 1 -- Basic Electricity1.
EEE305 Microcontroller Systems Lecture 5B: Simple I/O Embedded C using PIC microcontrollers Teaching resources on on
Embedded Systems Design 1 Lecture Set B Interfacing the MCS-51 to: –7 and 16 segment displays –a Multiplexed 7-Segment Display –a Keypad –an LCD.
Physics 120B: Lecture 4 LCD Text Display Keypads and Time Slicing Interrupts.
Embedded Programming and Robotics
LCD's 1. LCD Types Many types available. Most common are:  Character Pre-programmed with a set of alphanumeric characters & symbols Size range from 8×1.
Parallax 4x20 LCD (part number 27979) with Arduino Duemilanove
Parallel Ports of PC Methods of interfacing Examples.
RM2F Input / Output (I/O) Pin grouping code!. I/O Pin Group Operations: The Spin language has provisions for assigning values to groups of bits in the.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Overview What kind of LCD Interfacing the LCD Displaying Text and Numbers Common Issues.
System Resources INFO1119 (Fall 2012).
Digital Outputs LCD Display
Annie Ly Lawrence Cagatin EE485 Spring 2012 Tuffy Medical Devices.
A Simple Tour of the MSP430. Light LEDs in C LEDs can be connected in two standard ways. Active high circuit, the LED illuminates if the pin is driven.
Input/Output Ports and Interfacing
Practical Electronics & Programming
Franz Duran INTRODUCTION TO A RDUINO PROGRAMMING & INTERFACING Engr. Franz Duran, MEP-ECE RapidSignal Electronics.
LCD Interfacing.
Tweaking Your Simon Adding a photoresistor and changing code Instruction by Pete Lewis and Linz Craig.
Parallel Interfacing Chapter 7. Parallel Interfacing Parallel I/O Ports Using Parallel Ports Seven-Segment Displays Keypad Interfacing Liquid Crystal.
Advanced Digital Circuits ECET 146 Week 9 Professor Iskandar Hack ET 221G,
Digital Inputs Interfacing Keypad
Embedded Systems 7763B Mt Druitt College of TAFE Electrical Engineering Lesson 2 LCD Display Interfacing.
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
EE 316 Computer Engineering Junior Lab Project 2 Digital Yahtzee.
Department of Electronic & Electrical Engineering LCD character display (parallel interface). How to interface a LCD character display to a PIC.
Embedded Programming and Robotics Lesson 11 Arduino Interrupts 1.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
ECE 447 Fall 2009 Lecture 12: TI MSP430 External LCD.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
Vishwakarma government engineering college Prepare by. Hardik Jolapara( ) LCD Interfacing with ATmega16.
Programming PIC 16F84A in Assembly. PIC16F84 pin-out and required external components.
LED AND KEYBOARD INTERFACING PREPARED BY :- PREPARED BY :- RAVAL AKASH ( ) RAVAL AKASH ( ) PATEL HARDIK ( ) PATEL HARDIK.
Arduino Programming Part 6: LCD Panel Output ME 121 Portland State University.
Infrared Proximity Sensors & Liquid Crystal Display Instructor Dr Matthew Khin Yi Kyaw.
Sitarambhai Naranjibhai Patel Institute of Technology and Research Centre, Umrakh, Bardoli. A Presentation On “ 16x2 LCD Interfacing with AVR atmega32.
Using a SparkFun™ serial LCD with an Arduino
Scrolling LCD using Arduino.
Lab 2: Arduino Sensors Topics: Arduino Sensor Reading, Display
Peripherals – Keypad The Keypad provides a simple means of numerical data or control input. The keys can be attributed whatever data or control values.
LCD Interfacing using Atmega 32
Display Devices 16 x 2 lcd display.
CS4101 Introduction to Embedded Systems Lab 10: Tasks and Scheduling
UNIVERSAL COLLEGE OF ENGINEERING & TECHNOLOGY
LCD.
Liquid Crystal Display Arduino
DIGITAL CALCULATOR USING 8051
EET 2261 Unit 11 Controlling LCD and Keypad
EET 2261 Unit 11 Controlling LCD and Keypad
Welcome to Digital Electronics using the Arduino Board
LCD and Keyboard Interfacing
LCD and Keyboard Sepehr Naimi
LCD and Keyboard Interfacing
Keypad Source: under under
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Keypad Source: under under
LCD (LIQUID CRISTAL DISPLAY) SCREENS
CTY SAR FCPS Vedant mathur, Juliana schalkwyk
LCD.
Presentation transcript:

Embedded Programming and Robotics Lesson 9 Keypad and LCD Display 1

The Keypad The keypad is similar to a telephone keypad, with a few extra keys You’ll need to download libraries to run it from eypad eypad Keypad and LCD Display2

Connecting the Keypad The keypad requires 8 I/O pins, one per row and one per column This is a lot considering what is available Connect power and ground Keypad and LCD Display3

Keypad Programming Overview The keypad doesn’t output characters; it outputs scan codes It requires 8 digital inputs, 4 for the rows and 4 for the columns When you create the Keypad object, you can map these to characters Keypad and LCD Display4

Include Files #include Keypad and LCD Display5

Set up Keypad data const byte numRows = 4; //number of rows on the keypad const byte numCols = 4; //number of columns on the keypad Pins connected to rows and columns byte rowPins[numRows] = {38, 36, 34, 32}; //Rows 0 to 3 byte colPins[numCols] = {30, 28, 26, 24}; //Columns 0 to 3 Keypad and LCD Display6

Set Up Keypad Mapping //keymap maps buttons to characters char keymap[numRows][numCols] = { {'1', '2', '3', 'A'}, {'4', '5', '6', 'B'}, {'7', '8', '9', 'C'}, {'*', '0', '#', 'D'} }; Keypad and LCD Display7

Create a Keypad Object Keypad myKeypad = Keypad(makeKeymap(keymap), rowPins, colPins, numRows, numCols); Keypad and LCD Display8

Get a Character Determine if there is anything from the keypad, and get it if there is. Note that “NO_KEY” is defined in key.h as binary zero. char keypressed = myKeypad.getKey(); if (keypressed != NO_KEY) { Serial.print("Key pressed "); Serial.println(keypressed + '0'); } Keypad and LCD Display9

Using the Keypad Best to use the keypad in programs that do not use delay(), since that can make it seem unresponsive We used this in a robot that had an Arduino Mega so we could choose programs during operation, rather than loading new programs every time we changed something. Keypad and LCD Display10

The Liquid Crystal Display (LCD) The LCD panel has 2 lines of 16 characters each It can be used to display status, time, direction, etc. Less useful in robots, and more with Raspberry Pi Keypad and LCD Display11

The Liquid Crystal Display (LCD) The Hitachi-compatible LCDs can be controlled in two modes: 4-bit or 8-bit The 4-bit mode requires seven I/O pins from the Arduino, while the 8- bit mode requires 11 pins. For displaying text on the screen, you can do nearly everything in 4- bit mode, which is what we’ll use Keypad and LCD Display12

LCD Panel Wiring Vdd connects to +5 V o controls the brightness Vss connects to ground Keypad and LCD Display13

LCD Panel Wiring Before wiring the LCD screen to your Arduino we suggest to solder a pin header strip to the connector of the LCD screen Connect the following pins: LCD RS pin to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin to digital pin 5 LCD D5 pin to digital pin 4 LCD D6 pin to digital pin 3 LCD D7 pin to digital pin 2 Keypad and LCD Display14

LCD Panel Wiring You can connect a 10K-Ohm potentiometer to the V 0 pin, controlling the brightness. (We didn’t order this part and it isn’t necessary) Keypad and LCD Display15

The Liquid Crystal Display (LCD) LCD Panel Pins: A register select (RS) pin that controls where in the LCD's memory you're writing data to. You can select either the data register, which holds what goes on the screen, or an instruction register, which is where the LCD's controller looks for instructions on what to do next. A Read/Write (R/W) pin that selects reading mode or writing mode An Enable pin that enables writing to the registers Keypad and LCD Display16

The Liquid Crystal Display (LCD) 8 data pins (D0 -D7). The states of these pins (high or low) are the bits that you're writing to a register when you write, or the values you're reading when you read. There's also a display constrast pin (Vo), power supply pins (+5V and Gnd) and LED Backlight (Bklt+ and BKlt-) pins that you can use to power the LCD, control the display contrast, and turn on and off the LED backlight, respectively. Keypad and LCD Display17

The LCD Panel #include Set up the LiquidCrystal object and tell it the pins (note these are on an Arduino Mega) LiquidCrystal lcd(42, 44, 46, 48, 50, 52); Keypad and LCD Display18

LCD Functions Initializes the panel with columns and rows lcd.begin(16, 2); Clears the panel lcd.clear(); Display something lcd.print(“Hello, World!"); Set the cursor position to col, row lcd.setCursor(col, row); Keypad and LCD Display19

Programming Exercise First program: Write a program that takes whatever you type at the keypad and puts it on the LCD display Second program: Write a program that lets you stop the robot and restart it from the keypad, and shows the state on the LCD panel Keypad and LCD Display20