Offline
Newbie
Karma: 0
Posts: 25
|
 |
« on: January 09, 2013, 01:36:47 pm » |
Hi, unfortunately I cannot spot out the difference. Can someone help me please?  By the way, I can split my project into 2 programs (just 2 tabs in the Arduino DE), right? Thanks
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #1 on: January 09, 2013, 01:37:47 pm » |
println prints a new line after the string. http://arduino.cc/en/Serial/Println
|
|
|
|
« Last Edit: January 09, 2013, 01:39:28 pm by AWOL »
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
Austin, TX
Offline
Faraday Member
Karma: 41
Posts: 5176
CMiYC
|
 |
« Reply #2 on: January 09, 2013, 01:46:21 pm » |
The reference documents clearly state it in the first sentence. http://arduino.cc/en/Serial/Print"Prints data to the serial port as human-readable ASCII text." http://arduino.cc/en/Serial/Println"Prints data to the serial port as human-readable ASCII text followed by a carriage return character (ASCII 13, or '\r') and a newline character (ASCII 10, or '\n')." Now, are you saying you don't understand that difference or you aren't seeing it in the serial monitor. If you aren't seeing it, run the command twice, back to back.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 25
|
 |
« Reply #3 on: January 09, 2013, 01:59:16 pm » |
Ah ok thanks, I've just seen this 
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 2
Posts: 140
|
 |
« Reply #4 on: January 09, 2013, 02:10:38 pm » |
what they said ^
also, careful that you know which you use too when you are trying to parse Serial data later, that has caught me a few times. Println actually prints a character ( I think it would be considered a character...?) so when you go to split multiple message it can throw you off.
|
|
|
|
|
Logged
|
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com
|
|
|
|
Poole, Dorset, UK
Offline
God Member
Karma: 8
Posts: 683
|
 |
« Reply #5 on: January 09, 2013, 02:44:44 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Austin, TX
Offline
Faraday Member
Karma: 41
Posts: 5176
CMiYC
|
 |
« Reply #6 on: January 09, 2013, 03:02:26 pm » |
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).
|
|
|
|
|
Logged
|
|
|
|
|
Poole, Dorset, UK
Offline
God Member
Karma: 8
Posts: 683
|
 |
« Reply #7 on: January 09, 2013, 03:13:07 pm » |
And they are always added in that order and never the other way round!.
Mark
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 2
Posts: 140
|
 |
« Reply #8 on: January 10, 2013, 04:35:17 am » |
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.
|
|
|
|
|
Logged
|
for(i = 0, i < 820480075, i++){ Design(); Code(); delay(1000); } // hellowoo.com
|
|
|
|
Global Moderator
UK
Offline
Brattain Member
Karma: 138
Posts: 19067
I don't think you connected the grounds, Dave.
|
 |
« Reply #9 on: January 10, 2013, 04:40:00 am » |
No, it isn't splitting hairs, they are actually two characters. From "Print.cpp" size_t Print::println(void) { size_t n = print('\r'); n += print('\n'); return n; }
|
|
|
|
|
Logged
|
Pete, it's a fool looks for logic in the chambers of the human heart.
|
|
|
|
|