Keypad

Hello, im getting this error:

“Alarmita_ita:18: error: ‘Keypad’ does not name a type”

In this code

"#include <Keypad.h>
char* secretCode = “1234”;
char* secretCode2 = “12345678”;
int position = 0;
const byte rows = 4;
const byte cols = 3;
char keys[rows][cols] = {
{‘1’,‘2’,‘3’},
{‘4’,‘5’,‘6’},
{‘7’,‘8’,‘9’},
{’*’,‘0’,’#’}
};
byte rowPins[rows] = {12, 11, 10, 9};
byte colPins[cols] = {8, 7, 6};
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, rows, cols);
byte switchs = A0;
byte pir = A3;
byte leds = A1;
byte sirena = A2;
byte altavoz = 13;
byte estado = 0;
byte cntPul = 0;
byte cntInt = 0;
char recibirDato;
long tiempo;
char key;
boolean claveBien = false;
boolean claveMal = false;
void setup();
{
Serial.begin(19200);
lcd.begin(16, 2);
pinMode(pir, INPUT);
pinMode(switchs, INPUT);
pinMode(leds, OUTPUT);
pinMode(sirena, OUTPUT);
pinMode(altavoz, OUTPUT);
Serial.print(“0”);
}void loop();
{

I do not understand where the problem is… Thanks for any help!

I do not understand where the problem is.

The problem is that the compiler doesn't know what a Keypad is.

Usually, this happens because you either have not downloaded a library, or you have not installed it correctly.

Newer versions of the IDE restored the fact that a missing include file is a fatal error. Some versions tried to pretend that it was no more than a nuisance warning.

void setup();
{
Serial.begin(19200); 
lcd.begin(16, 2); 
pinMode(pir, INPUT); 
pinMode(switchs, INPUT); 
pinMode(leds, OUTPUT); 
pinMode(sirena, OUTPUT); 
pinMode(altavoz, OUTPUT); 
Serial.print("0"); 
}void loop();
{

void setup() has its opening curly bracket (curly bracket = “{”) but the ending curly bracket ("}" is on the same line as "void loop(); ; they should be on their own separate line.

Also, void loop(); has its “{”, but its missing its matching “}”
I suspect it was not highlighted when you copied the sketch,
Please make sure, the matching “}” is included in your sketch…

But as PaulS pointed out, the keypad is probably not installed in your Arduino IDE .
The keypad.zip library can be downloaded it from here …

  • dan

You can use the IDE to download the library now (1.6.2 or above). I added it some time ago, and is a one click install, no restarting or bad placement errors.

The link from dsauriol also explains this process.

void setup();

That ; doesn't go there, either.