Need Help on Pic16f628A Combination Lock C Code wih LCD and 3*4 Keypad
Thu Oct 11 2007, 11:31 am
i didnt get why are you doing
keypad_Read()++; (this)
and
keypad_Read()+=attempts; (this)
explain me because i don't know how the value is being stored or incremented in attempts variable..
keypad_Read()++; (this)
and
keypad_Read()+=attempts; (this)
explain me because i don't know how the value is being stored or incremented in attempts variable..
Thu Oct 11 2007, 01:59 pm
Ajay, Thanks you very much for replies my questions. Finally I solved the problem.
At case 11 each time enter invalid pass we increment attempts by 1 as we passed through release button value stored and when three attempts entered go to state 16 "default" for output display message and next go to state 1 waiting for enter alarm off numbers..
case 11:
LCD_OUT(2,1,"Invalid") ;
while(!keypad_Read()){} //wait for enter key press
Delay_ms(10) ;//debounce time
kp = Keypad_Released() ;//wait for release
LCD_Cmd(LCD_CLEAR) ;
if(kp==13)
state =1;
attempts++; //increment attempts
kp+=attempts;//attempts = kp + attempts
if(attempts==3) //attempts equal 3 times
state =16; //goes next state 16
break;
At case 11 each time enter invalid pass we increment attempts by 1 as we passed through release button value stored and when three attempts entered go to state 16 "default" for output display message and next go to state 1 waiting for enter alarm off numbers..
case 11:
LCD_OUT(2,1,"Invalid") ;
while(!keypad_Read()){} //wait for enter key press
Delay_ms(10) ;//debounce time
kp = Keypad_Released() ;//wait for release
LCD_Cmd(LCD_CLEAR) ;
if(kp==13)
state =1;
attempts++; //increment attempts
kp+=attempts;//attempts = kp + attempts
if(attempts==3) //attempts equal 3 times
state =16; //goes next state 16
break;
Thu Oct 11 2007, 02:09 pm
yeah that is what i told you.. coz you were not incrementing attempts rather you were doing something else...
try this too...
remove this statement
kp+=attempts;//attempts = kp + attempts
as its not what you think its..
kp = kp + attemps;
so you don't need this statement in the case 11 code...
happy that it worked... do you want to post this project on my site?
try this too...
remove this statement
kp+=attempts;//attempts = kp + attempts
as its not what you think its..
kp = kp + attemps;
so you don't need this statement in the case 11 code...
happy that it worked... do you want to post this project on my site?
Fri Oct 12 2007, 03:09 am
Ajay, my project is not completed. I need add diodes hardware for door1 and door2 at output pic and a little modification the program again and after that i tidy up the project into one zip folder then i will post to on your website
See you again!! :-)
See you again!! :-)
Fri Oct 12 2007, 10:40 am
sure.. i was just asking if you want to post or not.. i will wait for the files.. please include a small description too.. Many people are waiting for PIC based projects..
Powered by e107 Forum System