Hello,
I need to install the library <Adafruit_Sensor.h>. How would I do that?
Is there a direct way via PlatoformIO? or can I move the zip file I already downloaded in a specific folder? Thank you
Good afternoon.
The library is the Adafruit Unified Sensor library and you have unfortunately been misled by the Arduino IDE into thinking that a *.h
file is a library.
This link shows you all about the library, its headers, compatible frameworks and, most importantly for you, installation instructions
All you do is put an entry for lib_deps
in your platforrmio.ini
file. On the next build, the library will be downloaded, compiled and linked to your executable.
HTH
Cheers,
Norm.
Thank you. The script I have also contains <Wire.h> and “Adafruit_TSL2591.h”. Are these included in Adafruit_Sensor.h so I can ignore these ‘include’ statements or shall I install other libraries?
If you look at the link above, there’s a tab with header file names which the library provides.
Wire.h is a built in header, so there’s no download required there. Just add the header as normal. The wire library is part of the Arduino framework – at least for AVR microcontroller based boards.
The other header file is part of this library and should be added to the ini file as before. Follow the instructions on the link.
Have fun.
HTH
Cheers,
Norm.