I am au fait with electronics and not a beginner in basic programming but I find the idea of a library in which the books are sealed closed defeats me. I am sure I must have missed something somewhere because it seems only logical that code from the items in the Arduino Library must be viewable in order to use it. Would someone please point out how I can see the code?
"Libraries" in the Arduino sense are just C++ header + source files.
You can see the source for the built-in ones here (Windows default install):
UM! Take a look at my avatar. It’s a real life image - almost. In standard understandable English, I want to read the code in a library file so I can see what it does. How do I open the file to do this? It’s all very well copying the examples provided but I want to design my own ‘sketch’ and if I am to use a library item in it I need to know how to use it, or at least that’s the way it seems to me. How can I do this?
the source code of libraries are distributed with the IDE, so you should be able to find them under
Or, If you're using OSX:
Right click on Arduino -> show package contents,
You can open any library file (.h and .cpp, are the usual extensions) in a text editor to view the source.
For more info, see here: Arduino - Libraries