"keypad" was not declared in this scope

#include <Password.h>
#include <LiquidCrystal.h>
#include <Keypad.h>

Password password = Password(“2346”);
int dlugsoc = 4;

LiquidCrystal lcd( A0, A1, A2, A3, A4, A5);

int buzzer = 10;
int ledGreen = 11;
int ledRed = 12;

int ilosc;

const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
{‘1’,‘2’,‘3’,‘A’},
{‘4’,‘5’,‘6’,‘B’},
{‘7’,‘8’,‘9’,‘C’},
{’*’,‘0’,’#’,‘D’}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the kpd
byte colPins[COLS] = {9, 8, 7, 6}; //connect to the column pinouts of the kpd

Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

unsigned long loopCount;
unsigned long startTime;
String msg;

void setup()
{
Serial.begin(9600);
keypad.aadEventListener(keypadvent);
pinMode(ledRed, OUTPUT);
pinMode(ledGreen, OUTPUT);
pinMode(buzzer, OUTPUT);

digitalWrite(ledRed, HIGH);
digitalWrite(ledGreen, LOW);

lcd.begin(16, 2);

lcd.setCursor(0,0);
lcd.print(" BIENVENIDO ");
lcd.setCursor(0,1);
lcd.print(“INGERSE CODIGO”);
}

void loop()
{

keypad.getKey();
}
void keypadEvent(KeypadEvent eKey)
{
switch (keypad.getKey())
{
case PRESSED:

int i;
for( i= 1; i<= 1; i++ )
{
digitalWrite(buzzer, HIGH);
delay(200);
digitalWrite(buzzer, LOW);
delay(100);
}

Serial.print("Pressed: ");
Serial.print(eKey);

switch (eKey)
{
/*

  • case"#":
  • break;
  • case"*";
  • break;
    */

default:
ilosc=ilosc+1;
password.append(eKey);
}
//Serial.print(ilosc);

if(ilosc == 1)
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("");
}
if(ilosc == 2);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("**
");
}
if(ilosc == 3);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("
");
}
if(ilosc == 4);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("
**");
}
if(ilosc == 5);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print(“");
}
if(ilosc == 6);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("
*
”);
}
if(ilosc == 7);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("*******");
}
if(ilosc == 8);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("********
");
}

if(ilosc == dlugosc)
{
delay(250);
checkPassword();
ilosc = 0;
}
}
}

void checkPassword()
{
if (password.evaluate())
{
int i;
for( i = ; i <= 3; i++ )
{
digitalWrite(buzzer, HIGH);
delay(120);
digitalWrite(buzzer, LOW);
delay(70);
}
ilosc = 0;
password.reset();

Serial.print(“Correcto”);

digitalWrite(ledRed, LOW);
digitalWrite(ledGreen, HIGH);

lcd.clear();
lcd.setCursor(0,1);
lcd.print("<>");

delay(2000);
digitalWrite(ledRed, HIGH);
digitalWrite(ledGreen, LOW);

lcd.setCursor(0,0);
lcd.print(" BIENVENIDO ");
lcd.setCursor(0,1);
lcd.print(“INGERSE CODIGO”);

}
else
{
int i;
for( i = ; i <= ; i++ )
{
digitalWrite(buzzer, HIGH);
delay(300);
digitalWrite(buzzer, LOW);
delay(100);
}
ilosc = 0;
password.reset();

Serial.print(“Error”);

digitalWrite(ledRed, HIGH);
digitalWrite(ledGreen, LOW);

lcd.clear();
lcd.setCursor(0,0);
lcd.print("<>");
delay(2000);

lcd.setCursor(0,0);
lcd.print(" BIENVENIDO ");
lcd.setCursor(0,1);
lcd.print(“INGERSE CODIGO”);

}
}
} // End loop

Hi and welcome.

Some stuff to help you on your way (click!)

#include <Password.h>
#include <LiquidCrystal.h>
#include <Keypad.h>

Password password = Password(“2346”);
int dlugsoc = 4;

LiquidCrystal lcd( A0, A1, A2, A3, A4, A5);

int buzzer = 10;
int ledGreen = 11;
int ledRed = 12;

int ilosc;

const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
{‘1’,‘2’,‘3’,‘A’},
{‘4’,‘5’,‘6’,‘B’},
{‘7’,‘8’,‘9’,‘C’},
{’*’,‘0’,’#’,‘D’}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the kpd
byte colPins[COLS] = {9, 8, 7, 6}; //connect to the column pinouts of the kpd

Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

unsigned long loopCount;
unsigned long startTime;
String msg;

void setup()
{
Serial.begin(9600);
keypad.aadEventListener(keypadvent);
pinMode(ledRed, OUTPUT);
pinMode(ledGreen, OUTPUT);
pinMode(buzzer, OUTPUT);

digitalWrite(ledRed, HIGH);
digitalWrite(ledGreen, LOW);

lcd.begin(16, 2);

lcd.setCursor(0,0);
lcd.print(" BIENVENIDO ");
lcd.setCursor(0,1);
lcd.print(“INGERSE CODIGO”);
}

void loop()
{
keypad.getKey();
}
void keypadEvent(KeypadEvent eKey)
{
switch (keypad.getKey())
{
case PRESSED:

int i;
for( i= 1; i<= 1; i++ )
{
digitalWrite(buzzer, HIGH);
delay(200);
digitalWrite(buzzer, LOW);
delay(100);
}

Serial.print("Pressed: ");
Serial.print(eKey);

switch (eKey)
{
/*

  • case"#":
  • break;
  • case"*";
  • break;
    */

default:
ilosc=ilosc+1;
password.append(eKey);
}
//Serial.print(ilosc);

if(ilosc == 1)
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("");
}
if(ilosc == 2);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("**
");
}
if(ilosc == 3);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("
");
}
if(ilosc == 4);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("
**");
}
if(ilosc == 5);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print(“");
}
if(ilosc == 6);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("
*
”);
}
if(ilosc == 7);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("*******");
}
if(ilosc == 8);
{
lcd.clear();
lcd.setCursor(1,0);
lcd.print(" < PIN >");
lcd.setCursor(0,1);
lcd.print("********
");
}

if(ilosc == dlugosc)
{
delay(250);
checkPassword();
ilosc = 0;
}
}
}

void checkPassword()
{
if (password.evaluate())
{
int i;
for( i = ; i <= 3; i++ )
{
digitalWrite(buzzer, HIGH);
delay(120);
digitalWrite(buzzer, LOW);
delay(70);
}
ilosc = 0;
password.reset();

Serial.print(“Correcto”);

digitalWrite(ledRed, LOW);
digitalWrite(ledGreen, HIGH);

lcd.clear();
lcd.setCursor(0,1);
lcd.print("<>");

delay(2000);
digitalWrite(ledRed, HIGH);
digitalWrite(ledGreen, LOW);

lcd.setCursor(0,0);
lcd.print(" BIENVENIDO ");
lcd.setCursor(0,1);
lcd.print(“INGERSE CODIGO”);

}
else
{
int i;
for( i = ; i <= ; i++ )
{
digitalWrite(buzzer, HIGH);
delay(300);
digitalWrite(buzzer, LOW);
delay(100);
}
ilosc = 0;
password.reset();

Serial.print(“Error”);

digitalWrite(ledRed, HIGH);
digitalWrite(ledGreen, LOW);

lcd.clear();
lcd.setCursor(0,0);
lcd.print("<>");
delay(2000);

lcd.setCursor(0,0);
lcd.print(" BIENVENIDO ");
lcd.setCursor(0,1);
lcd.print(“INGERSE CODIGO”);

}
}
} // End loop

You missed this part:

Some stuff to help you on your way (click!)