Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

scanf

Status
Not open for further replies.

tomand

Electrical
Feb 26, 2004
11
scanf take alot of program memory. I need to find an alternative to scanf. I need to read two numbers from seial port, add them and present the result.

As an example, I had the same problem with printf and at last found this code example:

void send_serial(unsigned char *s)
{while(*s != 0x0)
{
SBUF=*s; /*send out the character*/
while(!TI) /*wait until sent*/
{ }
TI=0;
s++; /*get the next character*/
}
}

This code takes much less space.

Thanks

Tom
 
Replies continue below

Recommended for you

why dont you try... inportb()


--------------------------------
Emmanuel A. Gonzalez, E.C.E.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor