hello, I need to work with the keyboard 3 * 4, but when I compile I get this mesaje ,
' This was not Declared In scope
and and I tried everything but it does not work . I could help please .
I leave copy of the program .
#include <Keypad.h>
char codigosecreto = '12345';
int position = 0;
const byte ROWS = 4; // cuatro filas
const byte COLS = 3; // tres columnas
char keys[ROWS][COLS] = {
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'},
};
byte rowPins[ROWS] = { 1, 2, 3, 4 }; // Conectar teclado ROW0, ROW1, ROW2 y Row3 a estos pines de Arduino
byte colPins[COLS] = { 5, 6, 7 }; // Conectar teclado Col"0" , col"1" y col"2" a estos pines de Arduino .
Keypad keypad1 = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
int Rojo = 9;
int Verde = 10;
void setup () {
pinMode (Rojo, OUTPUT);
pinMode (Verde, OUTPUT);
setLocked(true)
{
void loop () {
char key = keypad.getKey();
if (key == '*' || key == '#')
{
position = 0;
setLocked(true);
}
if (key == codigo secreto [position])
{
position ++;
}
if (position == 4)
{
setLocked(false);
}
delay(100);
void setLocked(int Locked) {
if (locked)
{
digitalWrite(redPin, HIGH);
digitalWrite(greenPin, LOW);
}
else
{
digitalWrite(redPin, LOW);
digitalWrite(greenPin, HIGH);
}
}
}
