PR 9B : Password Door Security V2010

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

Re: PR 9B : Password Door Security V2010

Postby ABSF » Fri Dec 31, 2010 10:39 am

Do you know how to modify the program code? Try to modidy it so that the number you pressed is shown on the LCD instead of just the "*". So you can tell whether the number that you entered is correct:

CODE: SELECT_ALL_CODE
void scancolumn2(void)
{
   if(RA0==0)                     //if key '4' is being pressed
   {
      while(RA0==0)continue;         //waiting the key to be released
      if(password_count==0)lcd_clr();   //Clear the LCD if the key is the 1st password
      lcd_goto(password_count);      //The cursor of LCD points to the column equivalent to the value of password_count variable
      send_char('*');               //Display the symbol '*' at LCD   
      keyin_char[password_count]='4';   //Stall the '4' value at the keyin_char array
      password_count+=1;            //increase the Password_count variable's value by 1 and the result stall back to the variable   
   }
   else if(RA1==0)                     //if key '5' is being pressed
   {
      while(RA1==0)continue;         //waiting the key to be released
      if(password_count==0)lcd_clr();   //Clear the LCD if the key is the 1st password
      lcd_goto(password_count);      //The cursor of LCD points to the column equivalent to the value of password_count variable
      send_char('*');               //Display the symbol '*' at LCD   
      keyin_char[password_count]='5';   //Stall the '5' value at the keyin_char array
      password_count+=1;            //increase the Password_count variable's value by 1 and the result stall back to the variable   
   }


Put the code :send_char('*');
after the code : keyin_char[password_count]='4';
as code : send_char('4');

Modify the rest of the code from ('*') to the corresponding numbers.

In this way when you keyin the password, you can see what numbers you've just entered. Then you can tell if your keypad is working properly. If you get '123456' and the message is still "FAIL", well, either the password in the program has been changed or your program is corrupted.

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Previous

Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 17 guests

cron