Zillion libraries

Ever sinec i started with Arduino my PC seems to filled with libraries of all sorts. Just look at the snap shot of all that those live in on my disk.

I have two queries :

  1. If i want my sketch to be compiled ONLY with the libraries that I choose, is it possible to group all of them and put in a folder called libraries in the sketch folder ? This is additional work but i am sure on any machine i will use the correct library only…

  2. If you look at the snapshot, you will see many libraries in temp folder. What are these and can these be deleted ?
    ArduinoLib.PNG

1) All libraries that you download should ALWAYS go in the folder called "libraries" in your sketchbook. A sketch will only use the libraries that you include.

2) Those in temp are made will compiling and will be gone once you close the IDE. Although that yeah fail with a IDE crash but they are in temp so Windows should clean them up if you run Disk clean-up. But you can delete all arduino_build_xxx folders in Temp if the IDE is closed.

All libraries-folders that start with c:\Windows.old is just you ;) You apparently did a reinstall of Windows and told Windows to keep the old installation which is then moved to C:\Windows.old.

The libraries-folders in c:\Program Files\Arduino (and sub-folders) are just the default libraries that come with the IDE. The libaries-folders in C:\Users[username]\AppData\Local\Arduino15 are just libraries that are part of extra boards you installed via the Board Manager.

For question 1

You can move 3rd party libraries to a 'repository'.

The ones that you need can be copied to the src directory (it's not there by default) in the sketch directory. Below an example how to move the IrRemote library.

E.g.

somesketch
  |
  +--src
  |   |
  |   +--IrRemote
  |        |
          ...
          ...
  |
  +--somesketch.ino

And in somesketch.ino you can use #include "src/IRremote/IRremote.h".