Accessing .h and .cpp files

Trying to find a list of functions. Another forum suggested -

"You can look at the source of libraries by looking at their .h and .cpp files
This will enable you to see which functions are available, the parameters passed to them and the value returned, if any. Of course, a properly written library will also have documentation, but this is often not provided or is inadequate."

How do I find these files?

Hi @Bishop1990. If you enable the "verbose output" option in the Arduino IDE preferences, the the paths of the all libraries that were used when compiling the sketch will be shown in the black output panel at the bottom of the Arduino IDE window. You will find the .h and .cpp files of the library under the folder at that path.

I'll provide instructions you can follow to do that:

  1. Open a sketch that uses the library of interest in Arduino IDE.
    If you don't already have a sketch, you can select one of the library's examples from Arduino IDE's File > Examples menu, or even just create a new sketch and add a #include directive for the library's header file.
  2. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  3. Check the box next to "Show verbose output during: ☐ compile" in the "Preferences" dialog.
  4. Click the "OK" button.
    The "Preferences" dialog will close.
  5. Select Sketch > Verify/Compile from the Arduino IDE menus.
  6. Wait for the compilation to finish.

Now examine the contents of the black "Output" panel at the bottom of the Arduino IDE window. You will see something like this there:

Using library Wire at version 1.0 in folder: C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\libraries\Wire 
Using library Servo at version 1.2.1 in folder: C:\Users\per\Documents\Arduino\libraries\Servo 

You can open the folder at the path you see there in your file manager or text editor. The .h and .cpp files might be located directly under that folder, or else under the src subfolder.