Serial.println() Question

Hello everyone.
Does Serial.println() function send both /r and /n special characters to the serial port or just /n ?

Thank you !!!

THE println() function sends both newline (0x0a) and carriage return (0x13).

1 Like

Thank you.
Is there a way that the Serial Terminal will display the special characters like /r and /n either in aschii or hex or dec format ?

Actually the /n is easy to see as the printing moves to the next line but i think /r can not be visualized somehow.

The serial monitor appears to respond to newline by moving to the beginning of the next line, while a carriage return by itself does nothing.

In minicom, newline moves to the next line, but does not change the horizontal position, while carriage return moves to the start of the current line without changing the vertical position.

The traditional sequence of carriage return followed by newline, verses the other way around, was in part to allow time for the print head to move horizontally to the beginning of the line.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.