Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct {
- char pass[6];
- int act;
- }habi;
- habi t[2];
- char given_password[] = "000000";
- t[0].pass[6]= "123123";
- t[0].act = 1;
- t[1].pass[6]= "123456";
- t[1].act = 1;
- int Check_password(){
- found =0;
- Lcd_Cmd(_LCD_CLEAR);
- for(i=0;i<2;i++){
- if(!memcmp(t[i].pass, given_password, 6)){
- Lcd_Out(1, 1, "Password Matched");
- Lcd_Out(2,1,"elevator is on");
- return 1;
- found=1;
- }
- }
- if (found==0){
- Lcd_Out(1, 1, "Incorrect Password");
- Lcd_Out(2, 1, "Try Again!");
- Delay_ms(2000);
- Password_prompt();
- return 0;}
- }
Add Comment
Please, Sign In to add comment