Go to Post Keep in mind that the lady Amanda has just taken a new job, moved herself to the NorthEast, and has to put up with people like Grady, Needel, the Kelsos, and Boucher. Let's give her some patience and sympathy. - Andy Baker [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-02-2004, 11:43
Jeff McCune's Avatar
Jeff McCune Jeff McCune is offline
Alpha Geek
#0677 (The Wirestrippers)
Team Role: Mentor
 
Join Date: Jan 2003
Location: The Ohio State University
Posts: 67
Jeff McCune is on a distinguished road
Send a message via ICQ to Jeff McCune Send a message via AIM to Jeff McCune
printf and newlines

I'm using minicom in unix to read back the data from printf... How the heck do I get a new line so I can get a scrolling set of values rather than just a single line that always overwrites itself? I've tried all permutations of \r and \n together. Do I need to set my terminal to something specific, vt100 or ansi or something?
__________________
Team 677 - The Wirestrippers - Columbus School for Girls and The Ohio State University
EMAIL: mccune@ling.ohio-state.edu

...And all you touch and all you see
Is all your life will ever be...
  #2   Spotlight this post!  
Unread 21-02-2004, 15:16
Happy Birthday! steven114 steven114 is offline
Programming Wizard and Team Captain
AKA: Steven Schlansker
FRC #0114 (Eaglestrike)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Los Altos, CA
Posts: 335
steven114 is a jewel in the roughsteven114 is a jewel in the roughsteven114 is a jewel in the rough
Send a message via AIM to steven114
Re: printf and newlines

Quote:
Originally Posted by Jeff McCune
I'm using minicom in unix to read back the data from printf... How the heck do I get a new line so I can get a scrolling set of values rather than just a single line that always overwrites itself? I've tried all permutations of \r and \n together. Do I need to set my terminal to something specific, vt100 or ansi or something?
I used the settings 152000 baud (or something like that) and CRLF line returns successfully with my terminal, but I don't use minicom specifically.
  #3   Spotlight this post!  
Unread 21-02-2004, 17:44
Jeff McCune's Avatar
Jeff McCune Jeff McCune is offline
Alpha Geek
#0677 (The Wirestrippers)
Team Role: Mentor
 
Join Date: Jan 2003
Location: The Ohio State University
Posts: 67
Jeff McCune is on a distinguished road
Send a message via ICQ to Jeff McCune Send a message via AIM to Jeff McCune
Re: printf and newlines

Quote:
Originally Posted by steven114
I used the settings 152000 baud (or something like that) and CRLF line returns successfully with my terminal, but I don't use minicom specifically.
CRLF is \r\n from the perspective of printf(), right? Just making sure I'm bot being an idiot.
__________________
Team 677 - The Wirestrippers - Columbus School for Girls and The Ohio State University
EMAIL: mccune@ling.ohio-state.edu

...And all you touch and all you see
Is all your life will ever be...
  #4   Spotlight this post!  
Unread 21-02-2004, 18:38
Happy Birthday! steven114 steven114 is offline
Programming Wizard and Team Captain
AKA: Steven Schlansker
FRC #0114 (Eaglestrike)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Los Altos, CA
Posts: 335
steven114 is a jewel in the roughsteven114 is a jewel in the roughsteven114 is a jewel in the rough
Send a message via AIM to steven114
Re: printf and newlines

Quote:
Originally Posted by Jeff McCune
CRLF is \r\n from the perspective of printf(), right? Just making sure I'm bot being an idiot.
I had just \n in the printf calls, \r is unneeded (afaik)
  #5   Spotlight this post!  
Unread 21-02-2004, 20:01
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: printf and newlines

I would guess that mplab uses ansi (ascii, 1 byte) letters. It's based on the compiler, since it translates strings to binary. that's also where \n stuff comes from.
  #6   Spotlight this post!  
Unread 21-02-2004, 21:09
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: printf and newlines

Quote:
Originally Posted by Jeff McCune
I'm using minicom in unix to read back the data from printf... How the heck do I get a new line so I can get a scrolling set of values rather than just a single line that always overwrites itself? I've tried all permutations of \r and \n together. Do I need to set my terminal to something specific, vt100 or ansi or something?
This probably won't help: I wanted to achieve the same thing (single, overwriting line) using the IFI loader's Terminal window. I tried \r, but it had the same result as \n.

I glanced at printf_lib.c and saw some stuff about \r, so there's hope. Have a look at printf_lib.c

-Norm
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 00:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi