The SPI library is a "platform bundled library". It is installed as a part of the Arduino boards platforms that add support for specific boards to the Arduino development software. The reason it is bundled with the platform instead of being installed globally like most Arduino libraries is that the low level implementation code of the library is very architecture specific. Because the API is standardized, it seems like you are always using the same SPI library, but in reality you might have a completely different library when compiling for one board or another.
- Select File > Preferences from the Arduino IDE menus.
- Check the box next to "Show verbose output during: compilation".
- Click the OK button.
- Compile any sketch that uses the SPI library.
After the compilation finishes, examine the contents of the black console pane at the bottom of the Arduino IDE window. There, you will see something like this:
Using library SPI at version 1.0 in folder: C:\Users\zapho\Documents\ArduinoData\packages\arduino\hardware\avr\1.8.4\libraries\SPI
That is the location of the source code.
The library source code will either be there or else in the
Another technique you can use is to open one of the example sketches of the library you are interested in and then select Sketch > Shown sketch folder. That will open the folder containing the example sketch in your file browser. From there, just navigate up to the root of the library.
The Microsoft store version is installed under
C:\Program Files\WindowsApps. I forget the exact name of the folder, but it will have "Arduino" in it. That folder is hidden by default, so you need to configure your file browser to show hidden files.