Go Down

Topic: Serial.println (Read 1 time) previous topic - next topic

bspirit

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

Coding Badly


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

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

Zandaa

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.

bspirit

Thanks, i will take a look!

regards

bspirit

I see functions like this one,

Code: [Select]
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

AWOL

#5
Apr 02, 2010, 06:52 pm Last Edit: Apr 02, 2010, 06:57 pm by AWOL Reason: 1
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"
"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.

bspirit

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

Regards

Go Up