I’m building a project that leverages sensor data and have been having problems ever since I started including Adafruit’s Sensor Calibration library. More specifically, at compile time I’m seeing the following error message:
In file included from .pio/libdeps/altimeter/Adafruit Sensor Calibration/Adafruit_Sensor_Calibration.h:61:0, from .pio/libdeps/altimeter/Adafruit Sensor Calibration/Adafruit_Sensor_Calibration.cpp:1: .pio/libdeps/altimeter/Adafruit Sensor Calibration/Adafruit_Sensor_Calibration_SDFat.h:14:10: fatal error: Adafruit_SPIFlash.h: No such file or directory
And this is what the offending line in the library looks like:
#if defined(EXTERNAL_FLASH_DEVICES) || defined(PIN_QSPI_SCK) #include <Adafruit_SPIFlash.h> #define ADAFRUIT_SENSOR_CALIBRATION_USE_FLASH
What’s weird is that
#include <Adafruit_SPIFlash.h> was already included in my main.cpp long before I started using the sensor calibration library and it never gave me any issues about not finding the SPIFlash header file.
My platformio.ini reads as follows:
[env:altimeter] platform = nordicnrf52 board = adafruit_clue_nrf52840 framework = arduino lib_ldf_mode = deep+ lib_deps = adafruit/Adafruit SPIFlash@^3.4.1 adafruit/SdFat - Adafruit Fork@^1.2.3 adafruit/Adafruit Arcada Library@^2.5.0 adafruit/Adafruit BMP280 Library@^2.1.1 adafruit/Adafruit EPD@^4.3.2 adafruit/Adafruit AHRS@^2.2.4 adafruit/Adafruit Sensor Lab@^0.4.2 adafruit/Adafruit Sensor Calibration@^1.1.2
And I can see both libraries
Adafruit Sensor Calibration and
Adafruit SPIFlash correctly installed in the project’s libdeps folder.
What am I missing?