Discussion in "PIC Microcontroller Discussion" started by    DAT    Oct 9, 2007.
Thu Oct 11 2007, 11:31 am
#11
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..
Thu Oct 11 2007, 01:59 pm
#12
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;
Thu Oct 11 2007, 02:09 pm
#13
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?
Fri Oct 12 2007, 03:09 am
#14
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!! :-)
Fri Oct 12 2007, 10:40 am
#15
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..

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am