Hello,
I have to ad a librairy that seems unknown by Platformio: “DFRobot_LCD.h”, because it does not finc it when I do a search from platfomrio home.
I don’t understand where I should copy this DFRobot_LCD.h file ???
I have read these topics “How to include Arduino Library in PlatformIO?” but it is unclear to me where I should copy this “.h” file.
(I prefer to keep it specific to my project because I do not want a future update to put the mess in my project).
It’s not just the .h file. The .h is just declaring functions that are implemented by the .cpp
file. Without that, you’d just get tons of undefined reference errors.
If the library you’re missing is GitHub - DFRobotdl/DFRobot_LCD, then just use PlatformIO’s library management system to add it. It accepts the path to a downloadable zip file. See documentation.
lib_deps =
https://github.com/DFRobotdl/DFRobot_LCD/archive/refs/heads/master.zip
Or, if you want to manually add the library, both .h and .cpp in a newly created folder in lib, e.g. lib/DFRobot_LCD
.
It is exactly what I was looking for !, but I have not found any “button” to tell him the path to the zip files: see attached image. I would prefer to proceed that way, but I dot see how to do !
Or, if you want to manually add the library, both .h and .cpp in a newly created folder in lib, e.g. lib/DFRobot_LCD
.
The question is where is this directory ? is it in C:\users\myname\documents\PlatformIO\name of my project\ ???
You have the “File Explorer” on the left side of VSCode as the first icon in the sidebar. Click on it. You’ll find the file structur of your project. There is a lib
folder. As well as the platformnio.ini
.
Agree, but the File Explorer does not allow me to indicate to PlatformIO where is the zipped file (it is what I am ideally look for):
Should I manually copy the library to the directory that is red squared on my image ??
OK I have manually copied all the librairies into the path that is squared in the image above, and it does not complain anymore about librairies…
But I have a compilation error related to a “}”, whereas I have copied/paste the source from the Arduino IDE where the compilation is OK: I will opened a new topic for this error, this one can be flagged as “solved”.
I will have a deeper look tomorrow because it is the night actually…
Thanks