comand to start new line in  the serial print

hi is there any way i could have my microcontroler do serial print and than do a new line and print again on the new line?

Serial.print('\n'); will print a carriage return.
So will Serial.println();

2 Likes

thnks.

@PaulS

Serial.print('\n'); will print a carriage return.
So will Serial.println();

Actually:

Serial.print('\n'); will print '\n', which is a newline character (sometimes called a "line feed").

Serial.println(); will print '\r' and '\n', which is a carriage return character followed by a newline character.

Although both outputs may appear the same on a terminal screen, sometimes it makes a difference to programs that are reading the stream.

To the Original Poater: You don't necessarily need a separate Serial.println() statement. If you want to print x on one line and y on the next line you can do this:

    Serial.println(x);
    Serial.println(y);

The next print after this will be on the line after y.

Regards,

Dave