Add an unlisted library

What is the syntax to add a library that is not listed with Particle?

For example, say I want to add the Queue library

Can it be added directly from GitHub or does it need to be downloaded?
If downloaded, is it referenced as a zip or must it be expanded?
If expanded, does it go in the Particle/community/libraries folder or in the project folder or somewhere else?
Is the “particle library add” command required?
And if so, how does it reference the library - by name, by path?

The reference docs aren’t clear about handling an unlisted library.

you have to add this library to web IDE manually.
the easiest way is:

  1. create new app for example Queue_Test.ino -> save.
  2. go to github repository choose any example click “Raw” then ctrl+a and ctrl+c
  3. go back to Web IDE and paste the example in to your app -> save.
  4. on the right top corner on Web IDE click “+” , give the name for new .cpp and .h file for example “cppQueue” -> save.
  5. go back to github /Queue/src/cppQueue.cpp click “Raw” then ctrl+a and ctrl+c
  6. go back to Web IDE and paste in to your new cppQueue.cpp -> save
  7. go back to github /Queue/src/cppQueue.h click “Raw” then ctrl+a and ctrl+c
  8. go back to Web IDE and paste in to your new cppQueue.h (don’t worry if .h file is not empty just delete all and paste cppQueue.h copied from Github ) -> save.
  9. remove
 // This #include statement was automatically added by the Particle IDE.
#include "cppQueue.h"

which is on the top of your app -> save -> veryfy -> enjoy :slight_smile:

Needs to be downloaded.


What IDE are you using?

Using the Particle Workbench on VSCode, Windows - and using the CLI.

Library sources need to be placed in the lib folder.
If you import one available library you’ll see how the file structure needs to be set up.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.