Seeking Help: Porting Arduino Libraries for DS3502 Digital Potentiometer & LPS33HW Baro Pressure Sensor

I've only used the libraries that have already been modified (or created) for Particle, but this one doesn't look to have been ported yet.

I've got the DS3502 digital pot and LPS33HW baro pressure sensor hooked up to my Particle Photon via i2c. They are receiving power. I attempted to just crude copy/paste the library into folders in Workbench / Visual Studio Code, but it fails to compile stock.

I took a look at the particle docs for firmware libraries and porting; I can use libraries and write crude code, but I am way in over my head here :sweat_smile:

Anyone mind lending a hand with porting these?
I would be immeasurably grateful, I'm struggling staring at this hardware I cannot yet make sing :grinning:

The libraries:
Adafruit DS3502 Digital Potentiometer

Adafruit LPS35HW / LPS33HW (I have the 33*...same family, just has a ported sensor)

@worldburger, importing libraries into Workbench is easy but they need to follow a specific folder format. Fist, you need a 'lib' directory to put libraries into. Second, once you copy the Adafruit libraries into the lib directory, you need to make sure those libraries are correctly structured.

In the case of the two Adafruit libraries you have, each needs to have a src folder created and the .cpp an .hfiles for the code files moved to that folder. For example, in the case of the Adafruit_DS3502 library, this is the folder layout you need in your project'slib` folder:

lib -
     - Adafruit_DS3502
        - assets
        - examples
        - src         <-- you need to create this folder
    ...

You then move the Adafruit_DS3502.cpp and Adafruit_DS3502.h files into the src folder and you are done. You would do a similar thing with the Adafruit_LPS35HW library.

This will allow Particle Workbench to find the library code files and you should be able to compile correctly.

3 Likes

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