Loading...
Welcome,
Guest
. Please
login
or
register
.
May 19, 2013, 08:36:21 pm
|
Arduino Forum
::
Using Arduino
::
Sensors
:: Keypad.h
« previous topic
next topic »
Pages: [
1
]
Go Down
Print
Author
Topic: Keypad.h (Read 643 times)
0 Members and 1 Guest are viewing this topic.
trendski
Durham UK
Offline
Full Member
Karma: 1
Posts: 159
aka Craig Turner
Keypad.h
«
on:
November 09, 2012, 11:52:54 am »
Bigger
Smaller
Reset
Hi,
I’m using a keypad these with the Keypad.h library and, yes it works fine. But I don’t understand how the arduino is handling the input from it. I get that when a key is pressed a connection is made between a row and a column pin, which when read by arduino gives us a particular key as a result.
When I attached my ohm meter to various pins on the keypad I was basically measuring a drop in resistance (probably Megohms down to a few ohms) when a connection was made and the matrix from these tests gave me the data for the library to use. I understand that to calculate ohms (R) you can use V and I.
Does anyone know how the arduiono is handling these inputs?
I already tried looking at the keypad.h file and didn’t get any further either.
Cheers
Logged
Craig Turner, blog:
http://gampageek.blogspot.co.uk/
It helps with my learning if I write things down, esp. for others to follow (constructive comments welcomed to improve)
robtillaart
Netherlands
Offline
Tesla Member
Karma: 87
Posts: 9371
In theory there is no difference between theory and practice, however in practice there are many...
Re: Keypad.h
«
Reply #1 on:
November 09, 2012, 01:09:47 pm »
Bigger
Smaller
Reset
Can you post a link to your keypad.h library?
There should also be one or more .cpp files.
The working is as follows:
the rows are outputs
the columns are input
The Arduino sets row 1 high.
then it checks all the columns if a line is becoming high if so key found
if none it does the same for row 2,3,4
If no line is found high return KeyNone or something like that.
(rows & columns can be swapped)
Logged
Rob Tillaart
Nederlandse sectie -
http://arduino.cc/forum/index.php/board,77.0.html
-
trendski
Durham UK
Offline
Full Member
Karma: 1
Posts: 159
aka Craig Turner
Re: Keypad.h
«
Reply #2 on:
November 09, 2012, 01:57:31 pm »
Bigger
Smaller
Reset
Here's the link:
arduino.cc/playground/uploads/Code/keypad.zip
robtillaart many thanks for the explanation, I think I understand it now.
Although the C files make heavy reading, I can see that they appear to be pulsing and checking row and column pins.
Cheers
Logged
Craig Turner, blog:
http://gampageek.blogspot.co.uk/
It helps with my learning if I write things down, esp. for others to follow (constructive comments welcomed to improve)
robtillaart
Netherlands
Offline
Tesla Member
Karma: 87
Posts: 9371
In theory there is no difference between theory and practice, however in practice there are many...
Re: Keypad.h
«
Reply #3 on:
November 09, 2012, 02:06:49 pm »
Bigger
Smaller
Reset
you should read the scankeys() function, that's the workhorse in this lib.
the implementation is more robust and has some additional functionality, e.g. it also suppresses bouncing switches so you get only one key instead of a zillion
Logged
Rob Tillaart
Nederlandse sectie -
http://arduino.cc/forum/index.php/board,77.0.html
-
trendski
Durham UK
Offline
Full Member
Karma: 1
Posts: 159
aka Craig Turner
Re: Keypad.h
«
Reply #4 on:
November 09, 2012, 02:23:08 pm »
Bigger
Smaller
Reset
Many thanks again. I'll check it out.
I believe it's a good idea for me understand the stuff I'm using in more depth, now.
I've been using arduino for just over 12 months now. It's a bit off post, but I just bought this book
http://www.amazon.co.uk/Introduction-Embedded-Systems-Development-Environment/dp/1608454983/ref=sr_1_9?s=books&ie=UTF8&qid=1352488796&sr=1-9
to help speed the path to better understanding
Cheers
Logged
Craig Turner, blog:
http://gampageek.blogspot.co.uk/
It helps with my learning if I write things down, esp. for others to follow (constructive comments welcomed to improve)
robtillaart
Netherlands
Offline
Tesla Member
Karma: 87
Posts: 9371
In theory there is no difference between theory and practice, however in practice there are many...
Re: Keypad.h
«
Reply #5 on:
November 09, 2012, 06:15:52 pm »
Bigger
Smaller
Reset
at first sight a very interesting book!
I put it on my wishlist
Logged
Rob Tillaart
Nederlandse sectie -
http://arduino.cc/forum/index.php/board,77.0.html
-
Pages: [
1
]
Go Up
Print
« previous topic
next topic »
|
Arduino Forum
::
Using Arduino
::
Sensors
:: Keypad.h
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> General Discussion
-----------------------------
Using Arduino
-----------------------------
=> Installation & Troubleshooting
=> Project Guidance
=> Programming Questions
=> General Electronics
=> LEDs and Multiplexing
=> Displays
=> Audio
=> Motors, Mechanics, and Power
=> Sensors
=> Networking, Protocols, and Devices
=> Interfacing w/ Software on the Computer
-----------------------------
Topics
-----------------------------
=> E-Textiles and Craft
=> Robotics
=> Science and Measurement
=> Home Automation and Networked Objects
=> Device Hacking
=> Education and Teaching
=> Interactive Art
=> Product Design
-----------------------------
Development
-----------------------------
=> Suggestions for the Arduino Project
=> Other Hardware Development
=> Other Software Development
-----------------------------
Community
-----------------------------
=> Website and Forum
=> Products and Services
=> Gigs and Collaborations
=> Workshops and Events
=> Local Groups
=> Exhibition / Gallery
=> Bar Sport
-----------------------------
International
-----------------------------
=> Deutsch
=> Español
=> Français
=> Italiano
=> Portugues
=> Scandinavia
-----------------------------
Forum 2005-2010 (read only)
-----------------------------
===> Uno Punto Zero
===> Bar Sport
===> Frequently-Asked Questions
===> News
===> Exhibition
===> Workshops
===> Interfacing
===> Bugs & Suggestions
===> Development
===> Troubleshooting
===> Portugues
===> Deutsch
===> Español
===> Français
===> Italiano
===> Scandinavia
===> Development
===> Interfacing
===> Syntax & Programs
===> Bugs & Suggestions
===> Troubleshooting
===> Report Spam at Arduino.cc
===> Forum
===> Playground Wiki
=> General
=> Hardware
=> Software
=> International
=> Web/Forum/Email/Spam
-----------------------------
Using Arduino
-----------------------------
=> Storage
=> Microcontrollers
-----------------------------
International
-----------------------------
===> Humor y Debate
===> Talleres, Encuentros, ...
===> Tutoriels et cours
===> Réalisations et Projets Finis
===> Le bar
=> Nederlands
===> Software
===> Hardware
===> Proyectos
===> Documentación
=> India
===> Hardware
===> Software
===> Megatopic
-----------------------------
Products
-----------------------------
=> The Arduino Starter Kit
=> Arduino Due
-----------------------------
International
-----------------------------
===> Generale
-----------------------------
Products
-----------------------------
=> Arduino Esplora
=> Arduino GSM Shield
-----------------------------
Maker Faire Rome - The European Edition
-----------------------------
=> Makers
=> Events and Tour
Loading...