Pages: [1]   Go Down
Author Topic: Serial Questions  (Read 541 times)
0 Members and 1 Guest are viewing this topic.
Minnesota!
Offline Offline
Sr. Member
****
Karma: 0
Posts: 386
My nickname on the forum used to be Soapy29.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Find AKSoapy29 on:
Youtube
Website

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 285
Posts: 25633
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not sure what you mean here.
Logged

"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.

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8653
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Minnesota!
Offline Offline
Sr. Member
****
Karma: 0
Posts: 386
My nickname on the forum used to be Soapy29.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Find AKSoapy29 on:
Youtube
Website

Minnesota!
Offline Offline
Sr. Member
****
Karma: 0
Posts: 386
My nickname on the forum used to be Soapy29.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How do I make a new line?
Logged

Find AKSoapy29 on:
Youtube
Website

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 285
Posts: 25633
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

println
http://arduino.cc/en/Serial/Println
Logged

"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.

0
Offline Offline
Sr. Member
****
Karma: 4
Posts: 329
KC4MM
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
>

Logged

0
Offline Offline
Sr. Member
****
Karma: 0
Posts: 360
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: