hey ! im new in arduino's word
my project is about acces systeme so the user need to type his ID then his password to pass
but my probleme is : how to make to loop wait untill the user type his password i don't how to fix this issue
please don't tell how to fix it , just comment the correct code here cause i don't undrestand english perfectly , thanks
#include <Keypad.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int idc,pwd ;
int x,i,cmp ;
char* Code ;
char* tab2[3]={'E','1','2'}; // ID
char* tab3[]={"1111","2222","3333"}; // PASSWD
char* tab[5]={"alaa","hamza","chaima"}; // NAME
const byte LIGNES = 4;
const byte COLONNES = 3;
const int L1=0;
const int L2=1;
const int L3=6;
const int L4=7;
const int C1=10;
const int C2=9;
const int C3=8;
char touches[LIGNES][COLONNES] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte BrochesLignes[LIGNES] = {L1, L2, L3, L4};
byte BrochesColonnes[COLONNES] = {C1, C2, C3};
char touche;
Keypad clavier = Keypad( makeKeymap(touches), BrochesLignes, BrochesColonnes, LIGNES, COLONNES );
void setup() {
lcd.begin(20, 4);
Serial.begin(9600);
pinMode(13,OUTPUT);
pinMode(A1, OUTPUT);
pinMode(A2,OUTPUT) ;
}
void loop() {
verif () ;
lcd.clear () ;
Code=tab3[1] ;
lcd.print (Code) ;
delay(1000) ;
passwd () ;
}
void verif () {
lcd.setCursor(0,0);
lcd.print("Entrez votre ID svp");
delay(600);
lcd.clear();
touche = clavier.getKey();
if (touche != NO_KEY){
Serial.print(touche);
Serial.print(" ");
delay(300) ;
for ( i=0 ; i < 3 ; i++ ) {
if (touche == tab2 ) { x=i ;} }
-
lcd.clear () ;*
-
lcd.setCursor(0,0);*
-
lcd.print("mdp svp") ;*
-
lcd.setCursor(0,1);*
-
lcd.print(tab[x]) ;*
-
delay(3000) ;*
-
lcd.clear () ;*
-
}*
-
int lal=1 ;*
-
if (x == 0 ) { lcd.print ("ERROR" ); delay (500) ; } }*
-
// verification ID*
void passwd () { -
int lap = 5 ;*
-
lcd.print(" ENTRER LE CODE : ");*
-
int l;*
-
int p=0 ;*
-
char touche = clavier.getKey();*
-
if(int(touche) != 0){*
-
Serial.print(touche) ;*
-
lcd.setCursor(1,1);*
-
lcd.print(" ");*
-
lcd.setCursor(8,1);*
-
for(l=0;l<=p;++l)*
-
{*
_ lcd.print("*");_ -
}*
-
if(touche == Code[p])*
-
{*
-
++p;*
-
if(p == 4)*
-
{*
-
lcd.setCursor(0,2);*
-
lcd.print(" BIENVENUE ");*
-
lcd.setCursor(0,3);*
-
lcd.print(" PATIENTEZ ");*
-
int lap = 1 ;digitalWrite(A1,HIGH);*
-
digitalWrite(A2,HIGH) ; // ouverture*
-
delay(3000) ;*
-
digitalWrite(A2,LOW);//arrete*
-
p=0;*
-
delay(2500);// le temps pour que le systeme doit apprendre pour auvrir la porte*
-
//digitalWrite(3,LOW);*
-
lcd.setCursor(0,1);*
-
lcd.print(" ");*
-
lcd.setCursor(0,2);*
-
lcd.print(" ");*
-
lcd.setCursor(0,3);*
-
lcd.print(" ");*
-
}*
-
}*
-
else{*
-
++p;*
-
if(p == 4)*
-
{*
-
lcd.setCursor(0,2);*
-
lcd.print(" CODE ERRONER ");*
-
lap = 0 ;*
-
delay(1500);*
-
p=0;*
-
lcd.setCursor(0,1);*
-
lcd.print(" ");*
-
lcd.setCursor(0,2);*
-
lcd.print(" ");*
-
lcd.setCursor(0,3);*
-
lcd.print(" ");*
-
}*
-
}*
-
} // verification PASSWD*
-
}*