Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
Feb 26, 2004
Messages
11
Location
CA
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
 
why dont you try... inportb()


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

Part and Inventory Search

Sponsor

Back
Top