Arduino vs ArduinoData directories

I have done a fresh install on Windows 10. If I look at the 'documents/Arduino/libraries' directory all that is there are the additions I brought over from Adafruit (unified_sensor for example). But if I look at 'documents/ArduinoData' this looks like where the bulk of the code has gone (directories for 'packages, staging', 7MB files for library_index, & preferences. The thing is that if I search for one of the examples such as consolePixel I cannot find it in this directory. This gets confusing because if I want to take the example code and save it out I cannot just copy the files in the examples directory. From the tutorials I have watched it looks like the code was all originally available and in the 'documents/Arduino/libraries' directory. Not sure how to find the examples files in the file system with their associated code, its definitely not in the libraries directory.
Do I need to uninstall & start over?

Hardware packages you install via the Arduino IDE's Boards Manager (Tools > Board > Boards Manager) are downloaded to documents/ArduinoData/staging/packages and documents/ArduinoData/staging/tools and then installed to documents/ArduinoData/packages.

Hardware packages often come with architecture-specific libraries bundled (e.g. SPI, Wire, SoftwareSerial).

Libraries you install or update via the Arduino IDE's Library Manager (Sketch > Include Library > Manage Libraries) are downloaded to documents/ArduinoData/staging/libraries and then installed to {sketchbook folder}/libraries. You can find the location of {sketchbook folder} in the Arduino IDE at File > Preferences > Sketchbook location. You need to make sure you are still using the same sketchbook folder as before the Windows update.

The files in documents/ArduinoData/staging are not actually used by the Arduino IDE after the installation, it's just a place to download the compressed files to.

garf222:
Not sure how to find the examples files in the file system with their associated code

The easiest way to find the location of an example sketch is to open it from the Arduino IDE's File > Examples menu and then do Sketch > Show Sketch Folder. That's only going to work if you actually have the library installed.

garf222:
its definitely not in the libraries directory.

Is the library even installed?

Thanks, that definitely helped. On your question of whether the libraries were even installed I checked C:\Program Files (x86)\Arduino\libraries, and that was not there (my fault, installed new version, saw old version was still there, did an uninstall and I think that deleted the libraries). I redid the install and that is now back

I also found the easy way to include .h files, and I am guessing their associated code using 'Sketch->include library' . This had me really puzzled, I was trying to figure out how to combine accelerometer code with the sd card code which is why I was trying to search for .h files for SD, but now I see it is actually much simpler with the Sketch->include library

newbie errors...

garf222:
I checked C:\Program Files (x86)\Arduino\libraries, and that was not there

Although it is possible to install libraries to the libraries subfolder of the Arduino IDE installation folder (C:\Program Files (x86)\Arduino in this case), it's not recommended because you will lose everything you save to that folder whenever you update to a different version of the Arduino IDE. It is best to always install libraries to the libraries subfolder of the sketchbook folder. Library Manager and Sketch > Include Library > Add .ZIP Library automatically install libraries to the sketchbook folder, so you only need to worry about this when you are doing a manual library installation. Some 3rd party libraries do tell you to install to the Arduino IDE installation folder in their instructions, but you should always ignore that. It's simply that the library author doesn't understand the proper way to install a library.

garf222:
I also found the easy way to include .h files, and I am guessing their associated code using 'Sketch->include library' .

There is no magic to Sketch->include library. It simply adds an #include directive for the library header file. There is absolutely no difference between Sketch->include library and you manually typing the #include directive line into your sketch. You are welcome to do whichever you prefer.

Good tip, and also good to know the mechanism of Sketch/include Library