So I have a project, find a useful library, then when I bring it in to the app I have also the example .cpp file. What is the correct proceedure to bring in the required parts but not the example - which gives me an unwanted loop and setup functions in the example file.
What did you do to import the library, âuse this exampleâ or âinclude in appâ? The former includes the current tab youâre in, whereas the latter should import only the library.
It might help to know which library youâre trying to use.
I have my original app and found the ELAPSEDMILIS library. My plan requiring non blocking timers.
The only options I see are are âInclude in Buildâ or âFork this libraryâ.
I certinly didnât want to work on another instance so I chose Include in Build.
I am new to all this Arduino / Github / Wiring ⌠stuff coming from an AVR C background - where I have to create it all.
The object is to create non blocking timers with callbacks.
It seems to work for me.
Go to the library, then click:
Then pick the app to which youâd like to add it.
Then, confirm by pressing:
You should then have something like:
// This #include statement was automatically added by the Particle IDE.
#include "elapsedMillis/elapsedMillis.h"
at the top of your app.
Give that a try?
Hi,
Yes, it did include it⌠but - and this is where i may be misunderstanding, when I went to the âIncluded Librarysâ button, it displayed three files
ElaspsedMillis.cpp, ElapsedMillis.h and ElapsedMillisDemo.cpp
Assuming all these files are in my app, I have two loop() and two setup() functions in the whole code, one from MY app and one in the example,cpp.
But⌠Ahh, I guess all thatâs actually in my app is the included .h file. and the button just gives me a link to view the original library.
Thanks for helping.