Go Down

Topic: Serial Questions (Read 642 times) previous topic - next topic

AKSoapy29

Hello, I have a question. How do I clear whatever is printed to the serial port?
Andrew K.

AWOL

Not sure what you mean here.
"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.

johnwasser

Depends entirely on what device is at the other end of the serial connection accepting and displaying the characters.

The built-in "Serial Monitor" appears not to have any such capability.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

AKSoapy29

Oh. Well nevermind then, I can't really right programs beside windows batch, and I'm not good at that.
Andrew K.

AKSoapy29

How do I make a new line?
Andrew K.

AWOL

println
http://arduino.cc/en/Serial/Println
"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.

RoyK

or Serial.print("\n");

\n is the code for newline.

Serial.print("hello\n");
will produce exactly the same output as
Serial.println("hello");

sometimes it's easier to use the newline character as for example  if you want to print several lines with
one statement like:

Serial.print("Hello\nMy name is Henry\nWhat is yours?\n>");
which will produce the following output:
Hello
My name is Henry
What is yours?
>


Aeturnalus

If you want it to work the same on every computer, use "\r\n" instead of "\n": then it'll display properly on windows, linux, and mac.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy