|
|
View previous topic :: View next topic |
Author |
Message |
jruibarroso
Joined: 07 Jan 2006 Posts: 64 Location: Braga
|
printing to RS232 , meaning of " \r" |
Posted: Mon Jan 29, 2007 12:09 pm |
|
|
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
|
|
|
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
Re: printing to RS232 , meaning of " \r" |
Posted: Tue Jan 30, 2007 8:30 am |
|
|
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! |
|
|
|
|
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
|