tejasgol721
Newbie level 1
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
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