keypad errors

i keep getting the following errors and cant see why:

error: variable or field ‘keypadEvent’ declared void
error: ‘KeypadEvent’ was not declared in this scope
error: ‘Keypad’ does not name a type
In function ‘void setup()’:
error: ‘keypad’ was not declared in this scope
error: ‘keypadEvent’ was not declared in this scope
In function ‘void loop()’:
error: ‘keypad’ was not declared in this scope
At global scope:
variable or field ‘keypadEvent’ declared void
‘KeypadEvent’ was not declared in this scope

from what i can see this error is usually due to the library not being in the right place however i think mine is fine, any help would be great

Thanks

dtmf_encode_2_0.ino (8.12 KB)

code was attached as it is too long for a comment btw

It seem that you did not properly install the Keypad library. I don't have that library. I compiled the program anyways, and got the exact same results.

dtmf_encode_2_0:1: error: variable or field 'keypadEvent' declared void
dtmf_encode_2_0:1: error: 'KeypadEvent' was not declared in this scope
dtmf_encode_2_0:17: error: 'Keypad' does not name a type
dtmf_encode_2_0.cpp: In function 'void setup()':
dtmf_encode_2_0:66: error: 'keypad' was not declared in this scope
dtmf_encode_2_0:66: error: 'keypadEvent' was not declared in this scope
dtmf_encode_2_0.cpp: In function 'void loop()':
dtmf_encode_2_0:72: error: 'keypad' was not declared in this scope
dtmf_encode_2_0.cpp: At global scope:
dtmf_encode_2_0:76: error: variable or field 'keypadEvent' declared void
dtmf_encode_2_0:76: error: 'KeypadEvent' was not declared in this scope

Next time, please post the code between code tags. You also have lots of repetitive, inefficient code.

I got the same errors. It seems Keypad is not in the core libraries.

I have a Keypad2 library (not sure where that came from) and by changing the include to read:

#include <Keypad2.h>

… it compiled without errors.

I also had to change near the start of the library file:

#include "WProgram.h"

to:

#if ARDUINO >= 100
  #include "Arduino.h"
#else
  #include "WProgram.h"
#endif

How to get the keypad2 library??

nehaberi: How to get the keypad2 library??

Is this what you are looking for?

http://playground.arduino.cc/Code/Keypad

This is my copy:

Keypad2.zip (5.72 KB)

Thank U