Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

scanf problem in keil

Status
Not open for further replies.

tejasgol721

Newbie level 1
Joined
Feb 13, 2014
Messages
0
Helped
0
Reputation
0
Reaction score
0
Trophy points
0
Activity points
0
hii,

i am using C8051F340DK.

my program is

main()
{
while(1)
{
prtintf();

scanf ("%d",&input_key); // problem is created hear


switch (case)
{
cases:
break;

default:
printf();
}
}
}



connection with PC is using UART

when i try with entering decimal no. it work properly.
now problem is when i try to enter character it print default and continuously print it.

when i was trying getchar() insted of scanf() it was waking properly.

so plz. help me to solve this prblem

Thanks;
Tejas
 

please write complete cource code!

....
switch(case)

after this is variable cases
is this OK?
 

Complete your source code if you want.We can learn together.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top