Code error with a ex arduino library

Hi - Im new to porting - and have created a private library for a SEEED digital light sensor - they provide arduino libraries only … Ive managed to upload iit successfully via the CLI … and can then see it and include it via the web IDE - Ive written a test bit of very simple code as below - … and the RAW of the compile fail (as no further details given): seems like the key line is fatal error: Digital_Light_TSL2561.h: No such file or directory - I suspect its something quite simple :slight_smile:

Ive included a screenshot of the structure of the library. Can anyone assist me please?

Here is the code …

.ino follows______

// This #include statement was automatically added by the Particle IDE.
#include <KMA_Digital_Light_TSL2561.h>
#include <Wire.h>
void setup() {
    Wire.begin();
    Serial.begin(9600);
    TSL2561.init();
}
void loop() {
//    Serial.print("The Infrared value is: ");
//    Serial.println(TSL2561.readIRLuminosity());  //read Infrared channel value only, not convert to lux.
 //   delay(1000);
}

---- excerpt from raw fail message

..ital_Light_TSL2561/src/KMA_Digital_Light_TSL2561.o lib/KMA_Digital_Light_TSL2561/src/KMA_Digital_Light_TSL2561.cpp
lib/KMA_Digital_Light_TSL2561/src/KMA_Digital_Light_TSL2561.cpp:31:10: fatal error: Digital_Light_TSL2561.h: No such file or directory
   31 | #include <Digital_Light_TSL2561.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
../build/module.mk:286: recipe for target '../build/target/user/platform-12-mKMA_Digital_Light_TSL2561/src/KMA_Digital_Light_TSL2561.o' failed
make[2]: *** [../build/target/user/platform-12-mKMA_Digital_Light_TSL2561/src/KMA_Digital_Light_TSL2561.o] Error 1
make[2]: Leaving directory '/firmware/user'
../../../build/recurse.mk:11: recipe for target 'user' failed
make[1]: *** [user] Error 2
make[1]: Leaving directory '/firmware/modules/argon/user-part'
../build/recurse.mk:11: recipe for target 'modules/argon/user-part' failed
make: *** [modules/argon/user-part] Error 2

Your project structure isn't quite correct
It should rather look like shown here

To get started with developing/porting a library in Particle workbench you can follow the steps as outlined here (obviously with some adaptations for your own library)

1 Like

Many thanks Scruff - I will look into this. If you know of a good resource that steps through this process for newbies - that would save a lot of hassle I think … Ive struggled each time Ive attempted this - but Im sure its pretty straightforward :slight_smile:

I'm not aware of something like this officially but I think the second link I posted should cover that nicely :wink:

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