Installing packages - where do the library source files go?

Greating to all Arduino uses!

My next project is going to require more horse power than the ATMega family can provide so I have bought a Fubarino SD card.

I have followed the instructions of adding the Board Manager URL and that has allowed all the ChipKit boards to be installed (as in I can see them listed in the Boards menu).

However, what I cannot locate are the relevant PIC32 libraries (I have tried let the OS search for relevant files)! I have tried on three development machines with the same result - so I suspect that I am doing something wrong, or that my understanding of the end result is incorrect.

Some technical details:

  • Two machines run Win10, the other Win7, all profressional installs
  • I have tried using 'run as administrator'

I have also downloaded the .zip version and can see both boards and library files in it - I could perform a manual install but the instructions are a little vague. My preference would be to provide feedback so that other users don't suffer the same issues I have.

I have also noticed that at times the preference.txt file does not contain the added URL.

Best regards,
Graham

Click the link at the line following File > Preferences > More preferences can be edited directly in the file. This will open the Arduino15 folder. This folder may be hidden from you by Windows by default so that would explain why the search you did failed to find the files.
You will find all the files of the hardware package in the packages\chipKIT subfolder of the Arduino15 folder.

Hi there,
Thanks for the pointer - the AppData folder was hidden and I can see that the packages are loaded below that.

I now have the expanded boards menu and also the libraries as well.

Question: How does the system differentiate between a Wire library from avr as against the same name for the PIC32?

It obviously does as I included it and checked the compiler output which indicated it got it all right. I have particular interest in the Wire library as I will need to expand it for my application.

Once modified do I place a folder in the "C:\Users\OEM\Documents\Arduino\libraries" location?

Do these package and user folders survive a re-install of the Arduino IDE?

Thanks,
Graham

KiwiGraham:
Question: How does the system differentiate between a Wire library from avr as against the same name for the PIC32?

It is chosen based on which board you have selected in the Tools > Board menu. The libraries bundled with hardware packages (such as the architecture dependent Wire library) are only available when a board of that hardware package is selected.

The libraries bundled with the Arduino IDE and those installed to the libraries subfolder of your sketchbook folder are available regardless of which board is selected. When there are header files of the same name included in multiple libraries in these locations the Arduino IDE uses several criteria to determine which one gets include priority. One these is the architectures value in the library.properties file of the library. If the architectures value of the library matches the architecture of the selected board (as determined by the architecture folder of the hardware package) then that library gets priority.

KiwiGraham:
Once modified do I place a folder in the "C:\Users\OEM\Documents\Arduino\libraries" location?

Yes, assuming C:\Users\OEM\Documents\Arduino is your sketchbook folder (as set in File > Preferences > Sketchbook location) that's the best place. Generally the libraries in that location will take include priority over the library bundled with a hardware package. The reason for this is to allow you do create modified libraries, as you are doing. Note that in older versions of the Arduino IDE this caused problems because the library in the sketchbook would always have priority, which is what you want when you have a chipKIT board selected but not what you want when you have an Arduino AVR Board selected, etc. This was the reason that the architecture matching behavior I described above was added. If the architecture does not match then the library bundled with the hardware package will have include priority. This means that when you have a chipKIT board selected the modified Wire library in your sketchbook will be used but if you have an Arduino AVR Board selected the Wire library bundled with Arduino AVR Boards hardware package is used.

KiwiGraham:
Do these package and user folders survive a re-install of the Arduino IDE?

Yes, and the library in the sketchbook folder will survive an update of the chipKIT hardware package, which is why it's best to install the modified library to your sketchbook folder rather than to the hardware package.