Use Arduino with specific library

I use Arduino successful from many years now. Recently I bought a Waveshare ESP32-S3-Touch-LCD-7 board. As I understood from the makers documentation, this board works with a LVGL library slight modified by Waveshare. My Question: The is any possibility to use Arduino IDE with this library saved somewhere in another folder ? If there is no any possibility, seems I have to erase the LVGL library from Arduino's library folder, replace with Waveshare's libraty, and change again these libraries when I revert to work with my previous sketches based on LVGL original libraries. Could someone help ? I am a beginner to medium user as a knowledge, and I work only for hobby. Thank you in advance

You could place a local copy the Waveshare version into the folder where your code resides.
Should work.

Hi @luciangn. There are a couple of possible approaches.

The one described by @robtillaart is a good one. There are some potential "gotchas" when using certain libraries with that approach, so if you give that a try and have any troubles, just let us know and we'll try to provide assistance.


An alternative approach which I think is a bit more simple, though perhaps also a bit inconvenient, would be to use a dedicated sketchbook folder. The standalone libraries like lvgl are stored in the libraries subfolder of the sketchbook folder, so if you change your sketchbook folder location then the libraries that are installed under that specific sketchbook folder will be used.

I'll provide instructions you can follow to configure the sketchbook folder location:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Click the "BROWSE" button to the right of the "Sketchbook location" preference field.
    The "Select new sketchbook location" dialog will open.
  3. Select a folder you want to use as your alternative sketchbook folder.
  4. Click the "Choose" button in the "Select new sketchbook location" dialog.
    The dialog will close.
  5. Click the "OK" button.
    The "Preferences" dialog will close.

Now install the Waveshare variant of the lvgl library, and any other libraries you want to use while developing sketches with the Waveshare variant of the lvgl library.

When you want to work on projects that use the standard lvgl library, repeat the procedure I described above, but this time select the original sketchbook folder.

Thank you very, very much

Thank you very much for the prompt answer.