Pages: [1]   Go Down
Author Topic: Serial.println  (Read 1149 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all!

Someone could tell me where i can find the source code of the function Serial.println used in IDE of arduino.
Thanks in advance!

Regards
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 200
Posts: 12779
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


{Arduino Path}\hardware\cores\arduino\Print.h

{Arduino Path}\hardware\cores\arduino\Print.cpp
Logged

+B011111
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

as said before, in the Arduino path, you look for hardware\cores\arduino
it has all the sourcecode for the individual arduino functions like digitalWrite, pinMode, etc. so if you fancy taking a look, that's where you'll need to be.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, i will take a look!

regards
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I see functions like this one,

Code:
void Print::println(const char c[]){
..
}

in this  file {Arduino Path}\hardware\cores\arduino\Print.cpp

 what this mean void Print::println? it is not usual to see this, i think.


regards
Logged

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

Quote
what this mean void Print::println? it is not usual to see this, i think

It means "println" is a member of the class "Print", and is  a "void" (i.e. it doesn't return a value) function.
That's C++, and perfectly usual.

You'll see that that there are different versions of the functions, distinguished only by their parameter types. This is called "overloading"
« Last Edit: April 02, 2010, 11:57:36 am by AWOL » 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
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, thanks, i never seen C++ source code, only C, that is why i couldn't understand.

Regards
Logged

Pages: [1]   Go Up
Jump to: