Arduino_DAY 2 - Session-1
Arduino_DAY 2 - Session-1
used in wide range of applications like CD/DVD players, Digital Watch etc.,
The main benefits of LCD are inexpensive; simply programmable, and there
are no limitations for displaying custom characters, simple animations, etc.
The liquid crystals are made up of a part solid, part liquid substance that can
be "twisted" by applying electrical voltage to them.
In the normal state, the crystals inside the liquid are twisted, and light can pass
through, once the crystals are subjected to an electrical current, they untwist,
blocking the light and makes the portion of the screen black.
DAY-2 Session-1 Arduino Programming Workshop 2
Among different sizes of LCDs (16x1, 16x2, 16x4, 20x4), 16x2 LCD display
is very basic module and is very commonly used in various devices and circuits.
A 16x2 LCD means it can display 16 characters per line and there are 2 such
lines. In this LCD each character is displayed in 5x7 pixel matrix.
When a key is pressed, a row and a column make a contact Otherwise; there
is no connection between rows and columns.
DAY-2 Session-1 Arduino Programming Workshop 11
STEP-1
STEP-2
STEP-3
STEP-4
DAY-2 Session-1 Arduino Programming Workshop 12
“Keypad” is a library for using matrix style keypads with the Arduino and
supports multiple keypresses.
In Arduino keypad library is used with header file #include <Keypad.h>
- Instantiates a Keypad object that uses pins 0,1,2,3s row pins, and 4,5,6,7as column pins for 4x4 keypad
DAY-2 Session-1 Arduino Programming Workshop 13
char waitForKey() - This function will wait forever until someone presses a key.
char getKey() - Returns the key that is pressed, if any.
KeyState getState()-Returns the current state of any of the keys. The four
states are IDLE, PRESSED, RELEASED and HOLD.
boolean keyStateChanged() – Let's you know when the key has changed from
one state to another.
setDebounceTime(unsigned int time) - Set the amount of milliseconds the
keypad will wait until it accepts a new keypress/keyEvent.
addEventListener(keypadEvent) - Trigger an event if the keypad is used.
For other APIs Refer: https://playground.arduino.cc/Code/Keypad/#Functions
Write a program to accepts input from a 4x4 keypad and displays it on the LCD.
Assume LCD operates in 4-bit with EN and RS active state. Simulate and verify this
logic on Arduino Uno using Tinkercad circuits simulator.
Calculator
ATM Machine