Hi!!! We're back with Arduino!!!
This video we will demonstrates how to map
a 4x4 keypad using the Arduino
library keypad.
The code turns the LED on pin 13 by clicking
the '*'(asterisk) key
and then turn it off by clicking '#'(hashtag)
key. The other keys reflects the key
value in the serial. easy easy!!
The first thing to do is count how many
pins are on your keypad. Our interface keypad
has 10 pins. We number from the second pin
to the ninth, leaving disconnected the ends.
Secondly, lets identifying the keypad pins.
You need to get a piece of paper and draw
the
right hand diagram as you see here. I've already
written my pin numbers.
I have drawn my keyboard in a mesh, to find
activators pins distributed in rows and columns.
Have patience at this time !! let's start
the game. You are going to use your Ohm meter
to
find out which pins are connected to which
keys.
There are eight pins distribute four to four.
four for the columns and four rows.
Once you've completed this procedure you will
know which key is activated by the mesh
meetings and write code to drive the matrix.
Picks column 2 with row 6. Stroll through
the keyboard to see which pin is actived by
that connection.
Cool, we find the button 1. Note on the chart
and keep going on...
Next, Picks column 2 with row 7. Oops, we
found the key 4. Write it down...
Continuing ...
2 with 8 results in key 7. We have already
noticed a pattern, does not it?
Now the star, who is the active? Easy is not
it! the meeting between the pins 2 and 8.
Now everything is easier !!!
We will repeat this same procedure to the
next column 3. Return the probe black for
the
pin 6 and follow the sequence again.
From now on it is very intuitive! I'll let
you watch
just enjoying the music. This is a piece of
cake !!!
Now let the distribution of jumpers on Arduino
pins. Nothing easier, see !!!
Let's see the code, which is quite simple.
We cataloged the project for publication and
noted the credits due to the rightful owner.
Only adapted the number of columns.
We note the pinout, already explained.
We include a library Keypad, which does the
heavy lifting!
Four row and four columns.
And the mapping of well-intuitive way keys.
We created the Keypad object that will be
required in the loop function.
In setup enable LED and lit it.
In the loop function we seek the key and tested
to find out if asterisk or hashtag
for us lit LED on pin 13 of the Arduino, just
to play ...
Ready, presented project. The idea is to add
a display for future projects.
Wait you the new video series. Thanks for
watching the video. Goodbye!!!
