Brand new to this. I have a Photon that I am learning, and enjoying. I’m a developer by trade, but doing this as a hobby. I also use C# - not C++, so this is new.
I use LEDs, Buzzers and PIR sensors a lot. And for LEDs for example, I have code to fade in and out, turn on and off etc. So I put my custom LED handler code into an LED class, and expose those functions. But I need to copy and paste the code from project to project.
Is there anyway to have a common area where I have my LED.h, Buzzer.h and PIR.h files, that all my mini projects can use. And as I enhance these helper classes, my projects get these updates next time I build them? Kinda like a common set of libraries.
Hope my question makes sense…
Which IDE are you using?
If you are using Web IDE you could setup a template project that contains all your desired headers (you may remove the ones not needed after the fact).
Each time you want to start a new project, you use the SHARE THIS REVISION feature of Web IDE to create a copy of your template, rename it to whatever you want and start building.
With local IDEs you could use filesystem links.
The more permanent solution would be to create a library (via CLI
particle library create), add your files as needed, then upload that library via
particle library upload and if you wish publish it via
particle library publish.
If you want to keep the library private, you should choose a personalised/unique name as any private library will block that name globally - so something like
utilities wouldn't be a name probably annoying other users who'd like to use that too
Once you have a library you can use it with any of the Particel IDEs.