aboutsummaryrefslogtreecommitdiff
path: root/Arduino/Libraies/Keypad
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2011-08-31 19:45:00 +0100
committerChristopher Baines <cbaines8@gmail.com>2011-08-31 19:45:00 +0100
commit96654ea19b12be4b43230f3ff9f908eebcb416ca (patch)
treed6c6100302db17c73e4d75673d637796cee9ffd6 /Arduino/Libraies/Keypad
parent4667303e15c534d390abee467eeaaee850e2d6f5 (diff)
downloadpunchingbag-96654ea19b12be4b43230f3ff9f908eebcb416ca.tar
punchingbag-96654ea19b12be4b43230f3ff9f908eebcb416ca.tar.gz
Initial commit for the modified libaries used and the ButtonMatrix arduino code. I have just cleaned this up, but not tested it.
Diffstat (limited to 'Arduino/Libraies/Keypad')
-rwxr-xr-xArduino/Libraies/Keypad/Examples/CustomKeypad/CustomKeypad.pde37
-rwxr-xr-xArduino/Libraies/Keypad/Examples/DynamicKeypad/DynamicKeypad.pde187
-rwxr-xr-xArduino/Libraies/Keypad/Examples/EventKeypad/EventKeypad.pde72
-rwxr-xr-xArduino/Libraies/Keypad/Examples/HelloKeypad/HelloKeypad.pde35
-rwxr-xr-xArduino/Libraies/Keypad/Keypad.cpp174
-rwxr-xr-xArduino/Libraies/Keypad/Keypad.h108
-rw-r--r--Arduino/Libraies/Keypad/README1
-rwxr-xr-xArduino/Libraies/Keypad/keywords.txt17
8 files changed, 631 insertions, 0 deletions
diff --git a/Arduino/Libraies/Keypad/Examples/CustomKeypad/CustomKeypad.pde b/Arduino/Libraies/Keypad/Examples/CustomKeypad/CustomKeypad.pde
new file mode 100755
index 0000000..408bcdb
--- /dev/null
+++ b/Arduino/Libraies/Keypad/Examples/CustomKeypad/CustomKeypad.pde
@@ -0,0 +1,37 @@
+/* @file CustomKeypad.pde
+|| @version 1.0
+|| @author Alexander Brevig
+|| @contact alexanderbrevig@gmail.com
+||
+|| @description
+|| | Demonstrates changing the keypad size and key values.
+|| #
+*/
+#include <Keypad.h>
+
+const byte ROWS = 4; //four rows
+const byte COLS = 4; //four columns
+//define the cymbols on the buttons of the keypads
+char hexaKeys[ROWS][COLS] = {
+ {'0','1','2','3'},
+ {'4','5','6','7'},
+ {'8','9','A','B'},
+ {'C','D','E','F'}
+};
+byte rowPins[ROWS] = {3, 2, 1, 0}; //connect to the row pinouts of the keypad
+byte colPins[COLS] = {7, 6, 5, 4}; //connect to the column pinouts of the keypad
+
+//initialize an instance of class NewKeypad
+Keypad cusomKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
+
+void setup(){
+ Serial.begin(9600);
+}
+
+void loop(){
+ char customKey = cusomKeypad.getKey();
+
+ if (customKey != NO_KEY){
+ Serial.println(customKey);
+ }
+}
diff --git a/Arduino/Libraies/Keypad/Examples/DynamicKeypad/DynamicKeypad.pde b/Arduino/Libraies/Keypad/Examples/DynamicKeypad/DynamicKeypad.pde
new file mode 100755
index 0000000..01f2ffe
--- /dev/null
+++ b/Arduino/Libraies/Keypad/Examples/DynamicKeypad/DynamicKeypad.pde
@@ -0,0 +1,187 @@
+/* @file DynamicKeypad.pde
+|| @version 1.0
+|| @author Mark Stanley
+|| @contact mstanley@technologist.com
+||
+|| @dificulty: Intermediate
+||
+|| *** THE KEYPAD REQUIRES PULL-UP RESISTORS ON THE ROW PINS. ***
+||
+|| @description
+|| | This is a demonstration of keypadEvents. It's used to switch between keymaps
+|| | while using only one keypad. The main concepts being demonstrated are:
+|| |
+|| | Using the keypad events, PRESSED, HOLD and RELEASED to simplify coding.
+|| | How to use setHoldTime() and why.
+|| | Making more than one thing happen with the same key.
+|| | Assigning and changing keymaps on the fly.
+|| |
+|| | Another useful feature is also included with this demonstration although
+|| | it's not really one of the concepts that I wanted to show you. If you look
+|| | at the code in the PRESSED event you will see that the first section of that
+|| | code is used to scroll through three different letters on each key. For
+|| | example, pressing the '2' key will step through the letters 'd', 'e' and 'f'.
+|| |
+|| |
+|| | Using the keypad events, PRESSED, HOLD and RELEASED to simplify coding
+|| | Very simply, the PRESSED event occurs imediately upon detecting a pressed
+|| | key and will not happen again until after a RELEASED event. When the HOLD
+|| | event fires it always falls between PRESSED and RELEASED. However, it will
+|| | only occur if a key has been pressed for longer than the setHoldTime() interval.
+|| |
+|| | How to use setHoldTime() and why
+|| | Take a look at keypad.setHoldTime(500) in the code. It is used to set the
+|| | time delay between a PRESSED event and the start of a HOLD event. The value
+|| | 500 is in milliseconds (mS) and is equivalent to half a second. After pressing
+|| | a key for 500mS the HOLD event will fire and any code contained therein will be
+|| | executed. This event will stay active for as long as you hold the key except
+|| | in the case of bug #1 listed above.
+|| |
+|| | Making more than one thing happen with the same key.
+|| | If you look under the PRESSED event (case PRESSED:) you will see that the '#'
+|| | is used to print a new line, Serial.println(). But take a look at the first
+|| | half of the HOLD event and you will see the same key being used to switch back
+|| | and forth between the letter and number keymaps that were created with alphaKeys[4][5]
+|| | and numberKeys[4][5] respectively.
+|| |
+|| | Assigning and changing keymaps on the fly
+|| | You will see that the '#' key has been designated to perform two different functions
+|| | depending on how long you hold it down. If you press the '#' key for less than the
+|| | setHoldTime() then it will print a new line. However, if you hold if for longer
+|| | than that it will switch back and forth between numbers and letters. You can see the
+|| | keymap changes in the HOLD event.
+|| |
+|| |
+|| | In addition...
+|| | You might notice a couple of things that you won't find in the Arduino language
+|| | reference. The first would be #include <ctype.h>. This is a standard library from
+|| | the C programming language and though I don't normally demonstrate these types of
+|| | things from outside the Arduino language reference I felt that its use here was
+|| | justified by the simplicity that it brings to this sketch.
+|| | That simplicity is provided by the two calls to isalpha(key) and isdigit(key).
+|| | The first one is used to decide if the key that was pressed is any letter from a-z
+|| | or A-Z and the second one decides if the key is any number from 0-9. The return
+|| | value from these two functions is either a zero or some positive number greater
+|| | than zero. This makes it very simple to test a key and see if it is a number or
+|| | a letter. So when you see the following:
+|| |
+|| | if (isalpha(key)) // this tests to see if your key was a letter
+|| |
+|| | And the following may be more familiar to some but it is equivalent:
+|| |
+|| | if (isalpha(key) != 0) // this tests to see if your key was a letter
+|| |
+|| | And Finally...
+|| | To better understand how the event handler affects your code you will need to remember
+|| | that it gets called only when you press, hold or release a key. However, once a key
+|| | is pressed or held then the event handler gets called at the full speed of the loop().
+|| |
+|| | *** THE KEYPAD REQUIRES PULL-UP RESISTORS ON THE ROW PINS. ***
+|| #
+*/
+#include <Keypad.h>
+#include <ctype.h>
+
+// Define the keymaps. The blank spot (lower left) is the space character.
+char alphaKeys[4][3] = {
+ { 'a','d','g' },
+ { 'j','m','p' },
+ { 's','v','y' },
+ { ' ','.','#' }
+};
+
+char numberKeys[4][3] = {
+ { '1','2','3' },
+ { '4','5','6' },
+ { '7','8','9' },
+ { ' ','0','#' }
+};
+
+boolean alpha = false; // Start with the numeric keypad.
+
+char* keypadMap = (alpha == true) ? makeKeymap(alphaKeys) : makeKeymap(numberKeys);
+
+// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these pins, eg. ROW0 = Arduino pin2.
+byte rowPins[] = { 9, 8, 7, 6 };
+
+// Connect keypad COL0, COL1 and COL2 to these pins, eg. COL0 = Arduino pin6.
+byte colPins[] = { 12, 11, 10 };
+
+//create a new Keypad
+Keypad keypad = Keypad(keypadMap, rowPins, colPins, sizeof(rowPins), sizeof(colPins));
+
+const byte ledPin = 13; // Use the LED on pin 13.
+
+void setup() {
+ Serial.begin(9600);
+ digitalWrite(ledPin, HIGH); // Turns the LED on.
+ keypad.addEventListener(keypadEvent); // Add an event listener.
+ keypad.setHoldTime(500); // Default is 1000mS
+ keypad.setDebounceTime(250); // Default is 50mS
+}
+
+void loop() {
+ char key = keypad.getKey();
+
+ if (alpha) { // Flash the LED if we are using the letter keymap.
+ digitalWrite(ledPin,!digitalRead(ledPin));
+ delay(100);
+ }
+}
+
+// Take care of some special events.
+void keypadEvent(KeypadEvent key) {
+ static char virtKey = NO_KEY; // Stores the last virtual key press. (Alpha keys only)
+ static char physKey = NO_KEY; // Stores the last physical key press. (Alpha keys only)
+ static char buildStr[12];
+ static byte buildCount;
+ static byte pressCount;
+
+ switch (keypad.getState())
+ {
+ case PRESSED:
+ if (isalpha(key)) { // This is a letter key so we're using the letter keymap.
+ if (physKey != key) { // New key so start with the first of 3 characters.
+ pressCount = 0;
+ virtKey = key;
+ physKey = key;
+ }
+ else { // Pressed the same key again...
+ virtKey++; // so select the next character on that key.
+ pressCount++; // Tracks how many times we press the same key.
+ }
+ if (pressCount > 2) { // Last character reached so cycle back to start.
+ pressCount = 0;
+ virtKey = key;
+ }
+ Serial.print(virtKey); // Used for testing.
+ }
+ if (isdigit(key) || key == ' ' || key == '.') Serial.print(key);
+ if (key == '#') Serial.println();
+ break;
+
+ case HOLD:
+ if (key == '#') { // Toggle between keymaps.
+ if (alpha == true) { // We are currently using a keymap with letters
+ keypad.begin(*numberKeys); // and want to change to numbers.
+ alpha = false;
+ }
+ else { // Or, we are currently using a keymap with numbers
+ keypad.begin(*alphaKeys); // and want to change to letters.
+ alpha = true;
+ }
+ }
+ else { // Some key other than '#' was pressed.
+ buildStr[buildCount++] = (isalpha(key)) ? virtKey : key;
+ buildStr[buildCount] = '\0';
+ Serial.println();
+ Serial.println(buildStr);
+ }
+ break;
+
+ case RELEASED:
+ if (buildCount >= sizeof(buildStr)) buildCount = 0; // Our string is full. Start fresh.
+ break;
+
+ } // end switch-case
+} // end keypad events
diff --git a/Arduino/Libraies/Keypad/Examples/EventKeypad/EventKeypad.pde b/Arduino/Libraies/Keypad/Examples/EventKeypad/EventKeypad.pde
new file mode 100755
index 0000000..db53ff0
--- /dev/null
+++ b/Arduino/Libraies/Keypad/Examples/EventKeypad/EventKeypad.pde
@@ -0,0 +1,72 @@
+/* @file EventSerialKeypad.pde
+|| @version 1.0
+|| @author Alexander Brevig
+|| @contact alexanderbrevig@gmail.com
+||
+|| @description
+|| | Demonstrates using the KeypadEvent.
+|| #
+*/
+#include <Keypad.h>
+
+const byte ROWS = 4; //four rows
+const byte COLS = 4; //four columns
+char keys[ROWS][COLS] = {
+ {'1','2','3','A'},
+ {'4','5','6','B'},
+ {'7','8','9','C'},
+ {'#','0','*','D'}
+};
+byte rowPins[ROWS] = {2,3,4,5}; //connect to the row pinouts of the keypad
+byte colPins[COLS] = {6,7,8,9}; //connect to the column pinouts of the keypad
+
+Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
+byte ledPin = 13;
+
+boolean blink = false;
+
+void setup(){
+ Serial.begin(9600);
+ pinMode(ledPin, OUTPUT); // sets the digital pin as output
+ digitalWrite(ledPin, HIGH); // sets the LED on
+ keypad.addEventListener(keypadEvent); //add an event listener for this keypad
+}
+
+void loop(){
+ char key = keypad.getKey();
+
+ if (key != NO_KEY) {
+ Serial.println(key);
+ }
+ if (blink){
+ digitalWrite(ledPin,!digitalRead(ledPin));
+ delay(100);
+ }
+}
+
+//take care of some special events
+void keypadEvent(KeypadEvent key){
+ switch (keypad.getState()){
+ case PRESSED:
+ switch (key){
+ case '#': digitalWrite(ledPin,!digitalRead(ledPin)); break;
+ case '*':
+ digitalWrite(ledPin,!digitalRead(ledPin));
+ break;
+ }
+ break;
+ case RELEASED:
+ switch (key){
+ case '*':
+ digitalWrite(ledPin,!digitalRead(ledPin));
+ blink = false;
+ break;
+ }
+ break;
+ case HOLD:
+ switch (key){
+ case '*': blink = true; break;
+ }
+ break;
+ }
+}
diff --git a/Arduino/Libraies/Keypad/Examples/HelloKeypad/HelloKeypad.pde b/Arduino/Libraies/Keypad/Examples/HelloKeypad/HelloKeypad.pde
new file mode 100755
index 0000000..c001965
--- /dev/null
+++ b/Arduino/Libraies/Keypad/Examples/HelloKeypad/HelloKeypad.pde
@@ -0,0 +1,35 @@
+/* @file HelloKeypad.pde
+|| @version 1.0
+|| @author Alexander Brevig
+|| @contact alexanderbrevig@gmail.com
+||
+|| @description
+|| | Demonstrates the simplest use of the matrix Keypad library.
+|| #
+*/
+#include <Keypad.h>
+
+const byte ROWS = 4; //four rows
+const byte COLS = 3; //three columns
+char keys[ROWS][COLS] = {
+ {'1','2','3'},
+ {'4','5','6'},
+ {'7','8','9'},
+ {'#','0','*'}
+};
+byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
+byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad
+
+Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
+
+void setup(){
+ Serial.begin(9600);
+}
+
+void loop(){
+ char key = keypad.getKey();
+
+ if (key != NO_KEY){
+ Serial.println(key);
+ }
+}
diff --git a/Arduino/Libraies/Keypad/Keypad.cpp b/Arduino/Libraies/Keypad/Keypad.cpp
new file mode 100755
index 0000000..3c7ffc6
--- /dev/null
+++ b/Arduino/Libraies/Keypad/Keypad.cpp
@@ -0,0 +1,174 @@
+/*
+||
+|| @file Keypad.h
+|| @version 1.8
+|| @author Mark Stanley, Alexander Brevig
+|| @contact mstanley@technologist.com, alexanderbrevig@gmail.com
+||
+|| @description
+|| | This library provides a simple interface for using matrix
+|| | keypads. It supports the use of multiple keypads with the
+|| | same or different sets of keys. It also supports user
+|| | selectable pins and definable keymaps.
+|| #
+||
+|| @license
+|| | This library is free software; you can redistribute it and/or
+|| | modify it under the terms of the GNU Lesser General Public
+|| | License as published by the Free Software Foundation; version
+|| | 2.1 of the License.
+|| |
+|| | This library is distributed in the hope that it will be useful,
+|| | but WITHOUT ANY WARRANTY; without even the implied warranty of
+|| | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+|| | Lesser General Public License for more details.
+|| |
+|| | You should have received a copy of the GNU Lesser General Public
+|| | License along with this library; if not, write to the Free Software
+|| | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+|| #
+||
+*/
+
+#include "Keypad.h"
+
+// <<constructor>> Allows custom keymap. pin configuration and keypad size
+Keypad::Keypad(char *userKeymap, byte *row, byte *col, byte rows, byte cols)
+{
+ rowPins = row;
+ columnPins = col;
+
+ //Serial.println("Override");
+ size.rows = rows;
+ //size.rows = 8;
+ size.columns = cols;
+ //size.columns = 16;
+
+ //Serial.print("Constructor Col ");
+ //int colSize = size.columns;
+ //Serial.print(colSize);
+ //int rowSize = size.rows;
+ //Serial.print(" Row ");
+ //Serial.println(rowSize);
+
+ begin(userKeymap);
+
+ lastUpdate = 0;
+ debounceTime = 50;
+ holdTime = 1000;
+ keypadEventListener = 0;
+ currentKey = NO_KEY;
+ state = IDLE;
+
+ initializePins();
+}
+
+// Let the user define a keymap - assume the same row- / columncount as defined in constructor
+void Keypad::begin( char *userKeymap){
+ keymap = userKeymap;
+}
+
+// Returns the keykode of the pressed key, or NO_KEY if no key is pressed
+char Keypad::getKey(){
+ //Serial.print("GetKey Col ");
+ //int colSize = size.columns;
+ //Serial.print(colSize);
+ //int rowSize = size.rows;
+ //Serial.print(" Row ");
+ //Serial.println(rowSize);
+ char key = NO_KEY; // Assume that no key is pressed, this is the default return for getKey()
+ for (byte c=0; c<size.columns; c++){
+ //Serial.print("col ");
+ //int cInt = c;
+ //Serial.println(cInt);
+ digitalWrite(columnPins[c],LOW); // Activate the current column.
+ for (byte r=0; r<size.rows; r++){ // Scan all the rows for a key press.
+ //Serial.print("row");
+ //int rInt = r;
+ //Serial.println(rInt);
+ // The user pressed a button for more then debounceTime microseconds.
+ if (currentKey == keymap[c+(r*size.columns)]){
+ // Button hold
+ if (((millis()-lastUpdate) >= holdTime) && digitalRead(rowPins[r]) == LOW){
+ transitionTo(HOLD);
+ }
+ // Button release
+ if (((millis()-lastUpdate) >= debounceTime) && digitalRead(rowPins[r]) == HIGH){
+ transitionTo(RELEASED);
+ currentKey = NO_KEY;
+ }
+ }
+ // Button pressed event. The user pressed a button.
+ else if (((millis()-lastUpdate) >= debounceTime) && digitalRead(rowPins[r]) == LOW){
+ digitalWrite(columnPins[c],HIGH); // De-activate the current column.
+ key = keymap[c+(r*size.columns)];
+ lastUpdate = millis();
+ goto EVALUATE_KEY; // Save resources and do not attempt to parse to keys at a time
+ }
+ }
+ digitalWrite(columnPins[c],HIGH); // De-activate the current column.
+ }
+
+ EVALUATE_KEY:
+ if (key != NO_KEY && key != currentKey){
+ currentKey = key;
+ transitionTo(PRESSED);
+ return currentKey;
+ }
+ else{
+ return NO_KEY;
+ }
+}
+
+
+KeypadState Keypad::getState(){
+ return state;
+}
+
+void Keypad::setDebounceTime(unsigned int debounce){
+ debounceTime = debounce;
+}
+void Keypad::setHoldTime(unsigned int hold){
+ holdTime = hold;
+}
+
+void Keypad::addEventListener(void (*listener)(char)){
+ keypadEventListener = listener;
+}
+
+//private
+void Keypad::transitionTo(KeypadState newState){
+ if (state!=newState){
+ state = newState;
+ if (keypadEventListener!=NULL){
+ keypadEventListener(currentKey);
+ }
+ }
+}
+
+void Keypad::initializePins(){
+ for (byte r=0; r<size.rows; r++){
+ for (byte c=0; c<size.columns; c++){
+ pinMode(columnPins[c],OUTPUT);
+ digitalWrite(columnPins[c],HIGH);
+ }
+ //configure row pin modes and states
+ pinMode(rowPins[r],INPUT);
+ digitalWrite(rowPins[r],HIGH);
+ }
+}
+
+/*
+|| @changelog
+|| | 2009-07-08 - Alexander Brevig : Library does not use 2d arrays
+|| | 2009-06-15 - Alexander Brevig : Added transitionTo
+|| | 2009-06-15 - Alexander Brevig : Added getState()
+|| | 2009-06-13 - Mark Stanley : Fixed bug in getKey() that returns the wrong key if debounceTime is too short.
+|| | 2009-06-13 - Mark Stanley : Minor bug fix: Added 'currentKey = NO_KEY' to constructors.
+|| | 2009-05-19 - Alexander Brevig : Added setHoldTime()
+|| | 2009-05-15 - Alexander Brevig : Changed begin() amd getKey(), this Library should be operational.
+|| | 2009-05-09 - Alexander Brevig : Changed getKey()
+|| | 2009-04-28 - Alexander Brevig : Modified API, and made variables private
+|| | 2007-XX-XX - Mark Stanley : Initial Release
+|| #
+*/
diff --git a/Arduino/Libraies/Keypad/Keypad.h b/Arduino/Libraies/Keypad/Keypad.h
new file mode 100755
index 0000000..bab6132
--- /dev/null
+++ b/Arduino/Libraies/Keypad/Keypad.h
@@ -0,0 +1,108 @@
+/*
+||
+|| @file Keypad.h
+|| @version 1.8
+|| @author Mark Stanley, Alexander Brevig
+|| @contact mstanley@technologist.com, alexanderbrevig@gmail.com
+||
+|| @description
+|| | This library provides a simple interface for using matrix
+|| | keypads. It supports the use of multiple keypads with the
+|| | same or different sets of keys. It also supports user
+|| | selectable pins and definable keymaps.
+|| #
+||
+|| @license
+|| | This library is free software; you can redistribute it and/or
+|| | modify it under the terms of the GNU Lesser General Public
+|| | License as published by the Free Software Foundation; version
+|| | 2.1 of the License.
+|| |
+|| | This library is distributed in the hope that it will be useful,
+|| | but WITHOUT ANY WARRANTY; without even the implied warranty of
+|| | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+|| | Lesser General Public License for more details.
+|| |
+|| | You should have received a copy of the GNU Lesser General Public
+|| | License along with this library; if not, write to the Free Software
+|| | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+|| #
+||
+*/
+
+#ifndef KEYPAD_H
+#define KEYPAD_H
+
+#include <WProgram.h>
+
+#define makeKeymap(x) ((char*)x)
+
+typedef char KeypadEvent;
+
+typedef enum {
+ IDLE=0,
+ PRESSED,
+ RELEASED,
+ HOLD
+} KeypadState;
+
+// : 8 refers to the variable occupying 8 bits of memory
+typedef struct {
+ byte rows : 8;
+ byte columns : 8;
+} KeypadSize;
+
+const char NO_KEY = '\0';
+#define KEY_RELEASED NO_KEY
+
+class Keypad {
+public:
+ /*
+ Keypad();
+ Keypad(byte row[], byte col[], byte rows, byte cols);
+ */
+ Keypad(char *userKeymap, byte *row, byte *col, byte rows, byte cols);
+
+ //void begin(); //DEPRECATED!
+ void begin(char *userKeymap);
+ char getKey();
+ KeypadState getState();
+ void setDebounceTime(unsigned int debounce);
+ void setHoldTime(unsigned int hold);
+ void addEventListener(void (*listener)(char));
+
+private:
+ void transitionTo(KeypadState newState);
+ void initializePins();
+
+ char *keymap;
+ byte *rowPins;
+ byte *columnPins;
+ KeypadSize size;
+ KeypadState state;
+ char currentKey;
+ unsigned long lastUpdate;
+ unsigned int debounceTime;
+ unsigned int holdTime;
+ void (*keypadEventListener)(char);
+};
+
+#endif
+
+/*
+|| @changelog
+|| | 1.8 2009-07-08 - Alexander Brevig : No longer uses arrays
+|| | 1.7 2009-06-18 - Alexander Brevig : This library is a Finite State Machine
+|| | every time a state changes the keypadEventListener will trigger, if set
+|| | 1.7 2009-06-18 - Alexander Brevig : Added setDebounceTime
+|| | setHoldTime specifies the amount of microseconds before a HOLD state triggers
+|| | 1.7 2009-06-18 - Alexander Brevig : Added transitionTo
+|| | 1.6 2009-06-15 - Alexander Brevig : Added getState() and state variable
+|| | 1.5 2009-05-19 - Alexander Brevig : Added setHoldTime()
+|| | 1.4 2009-05-15 - Alexander Brevig : Added addEventListener
+|| | 1.3 2009-05-12 - Alexander Brevig : Added lastUdate, in order to do simple debouncing
+|| | 1.2 2009-05-09 - Alexander Brevig : Changed getKey()
+|| | 1.1 2009-04-28 - Alexander Brevig : Modified API, and made variables private
+|| | 1.0 2007-XX-XX - Mark Stanley : Initial Release
+|| #
+*/
diff --git a/Arduino/Libraies/Keypad/README b/Arduino/Libraies/Keypad/README
new file mode 100644
index 0000000..504a22a
--- /dev/null
+++ b/Arduino/Libraies/Keypad/README
@@ -0,0 +1 @@
+Modified the bit fields in the KeypadSize structure to allow for a big enough matrix
diff --git a/Arduino/Libraies/Keypad/keywords.txt b/Arduino/Libraies/Keypad/keywords.txt
new file mode 100755
index 0000000..2ae39b8
--- /dev/null
+++ b/Arduino/Libraies/Keypad/keywords.txt
@@ -0,0 +1,17 @@
+Keypad KEYWORD1
+KeypadEvent KEYWORD1
+
+begin KEYWORD2
+getKey KEYWORD2
+getState KEYWORD2
+setHoldTime KEYWORD2
+addEventListener KEYWORD2
+
+# this is a macro that converts 2d arrays to pointers
+makeKeymap KEYWORD2
+
+# this is a way to standardize the client code, help enhance the use of the name keypadEvent
+keypadEvent KEYWORD2
+
+NO_KEY LITERAL1
+KEY_RELEASED LITERAL1