#include <Keypad.h>
#include <password.h>
const byte satir = 4;
const byte sutun = 4;
int counter = 0;
Password password = password ("0000");
cahr tustakimi [satir] [sutun] {
{'1', '2', '3', 'A'}
{'4', '5', '6', 'B'}
{'7', '8', '9', 'C'}
{'*', '0', '#', 'D'}
};
byte satirpin[satir] = {9,8,7,6};
byte sutunpin[sutun] = {13,12,11,10}
keypad pad = keypad (makekeypad(tustakimi), satirpin, sutunpin, satir, sutun)
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("sifre gir lan!");
pad.addEventListener(keypadevent);
}
void loop() {
// put your main code here, to run repeatedly:
pad.getkey();
}
void keypadevent(keypadevent eKey) {
switch (pad.pedState()){
case PRESSED:
if(eKey=='*'){
Serial.println("konrtol ediliyor");
}else if(eKey=='#'){
Serial.print(counter+2);
Serial.println(". kez sifrenizi giriyorsunuz ");
}else {
Serial.print(eKey);
}switch(eKey) {
case '*':
checlpassword
}
}
}