Go Down

Topic: difference Serial.print("Hello World") / Serial.println("Hello World") (Read 645 times) previous topic - next topic

holmes4

Serial uses ASCII and there are a full 256 char's. Some printing such as 'A' ect and some "non" printing such as null,cr,lf,nl,rubout backspace and lost of others but all are char's.

Mark

James C4S


Println actually prints a character ( I think it would be considered a character...?)

No, as the reference document states, Println adds two characters to the end of the string.  Carriage Return (13) and Linefeed (11).
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

holmes4

And they are always added in that order and never the other way round!.

Mark

hilukasz



Println actually prints a character ( I think it would be considered a character...?)

No, as the reference document states, Println adds two characters to the end of the string.  Carriage Return (13) and Linefeed (11).


yeah, splitting hairs at that point, but you're right its technically two. point being to watch out for them when splitting the message.
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com

AWOL

No, it isn't splitting hairs, they are actually two characters.

From "Print.cpp"
Code: [Select]
size_t Print::println(void)
{
  size_t n = print('\r');
  n += print('\n');
  return n;
}
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up