How to get source code for built-in functions

I would like to look at the source code - preferably in C/C++ - for some built in functions,
as well as the general register initialization and set-up for the Arduino environment,
in order to see the implementation details.

Functions:
analogRead()
micros()
main()

Where is this available?
Thanks.

Look in your folders \arduino\hardware\arduino\cores\arduino

At least some of them are there by name - main.cpp - to start with.

While that's a generally useful response it can't be completed without knowing the platform of the original poster.

I prefer to dig around on github :slight_smile:

https://github.com/arduino/Arduino/tree/new-extension/hardware/arduino/cores/arduino

My platform is Windows. Your responses have been helpful. Thanks.

All the Arduino source files are in the distrubution you installed. Built in shown below, supplied libraries in a different folder. You just need to look around.

C:\Documents and Settings\Primary Windows User\My Documents\My Programs\Arduino\arduino-0022\hardware\arduino\cores\arduino

0 Folders:

25 Files:

binary.h
HardwareSerial.cpp
HardwareSerial.h
main.cpp
org-WString.cpp
pins_arduino.c
pins_arduino.h
Print.cpp
Print.h
Stream.h
Tone.cpp
WCharacter.h
WConstants.h
WInterrupts.c
wiring.c
wiring.h
wiring_analog.c
wiring_digital.c
wiring_private.h
wiring_pulse.c
wiring_shift.c
WMath.cpp
WProgram.h
WString.cpp
WString.h

Lefty

The source code is available at
code.google.com/p/arduino