Discussion in "ARM Development" started by    vijay    Sep 30, 2012.
Sun Sep 30 2012, 09:23 pm
#1
i faced problem that without pressing any switch from keypad it shows '1'..at starting
and after that it don't show anything if i press keys..
i post my code+proteus simulation just see,...n help me fast
Attachment
Mon Oct 01 2012, 10:05 am
#2
First thing, you need to check your key logic as it should not detect any key... secondly
while(key_pressed())


This line will exit the main function so you wont be able to detect any key later on.. so have another while(1) loop outside the key_pressed checking loop.

[Topic moved to ARM Development Forum]
Mon Oct 01 2012, 06:04 pm
#3
i add while loop even though same problem is going on...What u said about while(key_pressed()) ..i cant understood it..can u make change in my programm and attach it here..i shall be very thankful to you
Mon Oct 01 2012, 10:02 pm
#4
thanx for help..........i changed my whole program and add some pull up register and i done it...thnx...
Tue Oct 02 2012, 01:12 am
#5
good job congrats.. this was the modification I suggested.

while (1) {
    while(key_pressed()) {
        //rest of the program...
    }
} //this is extra while loop preventing program to exit.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Davidbab
Tue Apr 23 2024, 10:41 am
Richardrit
Tue Apr 23 2024, 09:54 am
HenryLaf
Mon Apr 22 2024, 03:50 pm
bleradrar
Mon Apr 22 2024, 06:38 am
ppu-pro_ka
Sun Apr 21 2024, 07:39 pm
Infewow
Sun Apr 21 2024, 06:30 pm
HumanTak
Sun Apr 21 2024, 12:26 pm
Zacharybus
Sun Apr 21 2024, 02:45 am