|
|
View previous topic :: View next topic |
Author |
Message |
jonpaul Guest
|
Printf problems |
Posted: Mon May 12, 2003 4:07 pm |
|
|
I'm having trouble with printf statements. More specifically, I have a menu I want to display with options over a serial port to be picked up by hyperterminal. However, when I run the code I don't get a nice left justified menu, but more of a waterfall effect. It seems my \n isn't a true line feed. What is going on? This seems like there should be a simple fix, but I'm at a loss.
Here's the code:
do
{
printf("Welcome to the TB2 Flash Configurator\n");
printf("Please pick from the following options:\n");
printf("(1) Read flashID\n");
printf("(2) Write flashID\n");
printf("(3) Read Rindex\n");
printf("(4) Write Rindex\n");
printf("(5) Print array contents\n");
printf("(6) Write array contents\n");
printf("(7) Print memory contents\n");
printf("Choice: ");
choice=getc();
Any clues?
Jon-Paul
___________________________
This message was ported from CCS's old forum
Original Post ID: 14387 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: Printf problems |
Posted: Mon May 12, 2003 4:15 pm |
|
|
:=I'm having trouble with printf statements. More specifically, I have a menu I want to display with options over a serial port to be picked up by hyperterminal. However, when I run the code I don't get a nice left justified menu, but more of a waterfall effect. It seems my \n isn't a true line feed. What is going on? This seems like there should be a simple fix, but I'm at a loss.
-------------------------------------------------------------
It's a line feed only. That's the problem. With CCS,
you need to use "\r" to get the carriage return.
Example:
printf("Hello World\n\r");
You should review the example files to see how CCS does things.
The files are in this folder: C:\Program Files\Picc\Examples
___________________________
This message was ported from CCS's old forum
Original Post ID: 14388 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|