Particle libraries

Hi there. Below is a link to a video showing the creation of the library folder by installing an existing library.

In general, it is easier to explain if you begin by creating a new project. Then, add an existing library. Configure for device. Clean project. Build. Flash.

https://www.youtube.com/watch?v=t9cQ48oRL_w

To clarify a bit, I use the keys SHIFT, COMMAND, P to bring up the command line.
I choose “Particle: Find Libraries” first to verify the library is available.
Then, choose “Particle: Install Library” to install it. Your library folder will automatically be created in the project and the particular library included there, as in the video.

Importing is a little different. To switch between your projects, you need to prepare the existing project to be imported first. To do this, on a Mac, I change my existing “lib” folder, in the “Finder” to “lib-old”. Then, switch back to VSC and perform the import: “Particle: Import Project”.
Hopefully, you will see a new folder “lib” created with your intended library included within, in addition to your “lib-old” folder and it’s contents.

On import, if you forget to rename the folder above, you might get this error:
https://community.particle.io/t/issue-failed-to-import-project-lib-folder-exists/49823/4

There is a file called “project.properties” in your project which is updated when you install a library. It tracks the name and version. On the next import, this library (and version) will be automatically placed in your project.

Hope this helps!

1 Like