CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

printing to RS232 , meaning of " \r"

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jruibarroso



Joined: 07 Jan 2006
Posts: 64
Location: Braga

View user's profile Send private message Send e-mail MSN Messenger

printing to RS232 , meaning of " \r"
PostPosted: Mon Jan 29, 2007 12:09 pm     Reply with quote

When printing to RS232 , what is the meanning of "\r" after text
I know that "\n" is to change line , if others comand exists , which are they ?

Thank you all
cjenkins



Joined: 29 Jan 2007
Posts: 2

View user's profile Send private message

PostPosted: Mon Jan 29, 2007 12:16 pm     Reply with quote

This link should help,

http://www.wilsonmar.com/1eschars.htm

In particular, here
http://www.wilsonmar.com/1eschars.htm#endlinez
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

Re: printing to RS232 , meaning of " \r"
PostPosted: Tue Jan 30, 2007 8:30 am     Reply with quote

jruibarroso wrote:
When printing to RS232 , what is the meanning of "\r" after text
I know that "\n" is to change line , if others comand exists , which are they ?

Thank you all


'\n' is "new line"
'\r' is "carriage return"

Some C compilers will automatically translate the '\n' into "\r\n" (or "\n\r") which is why when you use Microsoft C or Borland C on a PC to write to the console, you use '\n' by itself.

Some terminal programs have a configuration inside to make the conversion for you so when it sees '\n' come in, it adds the carriage return too.

Another usefull escape character is '\t' for horizontal TAB. Search Google for an ASCII code table and also read cjenkins' links.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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