New to the Arduino community, im struggling with libraries
I have downloaded a few sketches, some of these sketches require different library versions, my question is.
How do i use a different version of a library for one sketch?
Tia
New to the Arduino community, im struggling with libraries
I have downloaded a few sketches, some of these sketches require different library versions, my question is.
How do i use a different version of a library for one sketch?
Tia
Would it be just temporary or you want more than version installed side by side?
Welcome btw!
Which libraries are you talking about? 3rd party libraries or libraries included with a board package?
Thank you, the libraries are for Rolling Clock by RandomNerdTutorials library is lvgl by kisvegabor installed on a Cheap Yellow Display, and the version requirement is 9.2.
The other Sketch cannot remember it off the top of my head uses a later version of the same library, however, when i then update the lvgl libray to use that sketch, and then go back to the previous sketch, i then have to install the previous version, i have to do this every time i want to switch sketches.
If there was a way to force the Arduino IDE to always use the correct library for a particular sketch, i know that there is the default library folder in the arduino folder itself and an additional library folder can be placed in the sketches library folder,
How do you get the IDE to check the sketches Library folder fist for required libraries, then defaulting to the main arduino library folder for libraries that are not found in the sketches library?
I also noticed that the #include libray statement can be used with either <> or "" when defining Library files needed by the sketch, can you also explain the difference between
#include <TFT_eSPI>
and
#define "TFT_eSPI"
Tia
<> is system
"" is local followed by system. Used to override a system declare
Have you tried with the latest version? If it does not work, just clock the version combo and select the version you want. NOW, never allow an update to happen, you will need to do manual updates.
BTW, are you sure this is not a boards V3 issue?
https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html
I dont think so, the sketch was compiling and uploading to the CYD successfully prior to going back to the other sketch, then after resetting back to the previous version of the library and going back to the original sketch it fails during compilation. I would have thought thatt Libraries situated in the sketches folder would be solely used for that sketch, irrespective of libraries found in the default Arduino Library. This issue is a pain (if it is an issue) it may just be me.
They are if you include them in the correct way (using double quotes instead of angled brackets).
The best way is probably to create a src directory in the sketch directory and move the library in the src directory. Use #include "src/yourLibrary/yourLibrary.h"
.
Thank you ill try that approach.
Well tried that approach and still failing to even successfully compile and upload a sketch/code onto my Cheap Yellow display, i have to say to the creators of the Ardiono IDE that ive used many IDE's in my 54 years and i can definitely say that Arduino IDE lacks the basics of User Friendliness i have been trying all sorts to get this working and keep getting error after error, never had this issue with MPLLab IDE or any other IDE for that matter.
Followed RandomNerdsTutorials on getting a Rolling Clock uploaded many times and still have issues with errors, uninstalled Arduino IDE many times then reinstalled back to the tutorial i go and still have the same issues with error after error, im at the point of giving up on Arduino and looking for an alternative thats more user friendly, Arduino CC sort this out for god sake.
The worst thing about this is the fact that you can get one sketch working after hours of faffing about , then move on to another project and that project kills the previous projects. How to kill a hobby stone cold, indtall Arduino IDE.
Get another IDE then.
"It can be programmed with: Arduino IDE, MicroPython, ESP-IDF"
https://randomnerdtutorials.com/cheap-yellow-display-esp32-2432s028r/
Or better, make one yourself then make it free.
How much money from the sale of that CYD went to Arduino and the development of the IDE? Yet the IDE is free to use for everyone, this forum is run with volunteers.
Before you whine, take a moment to think it through.
OK. maybe it's not the easiest as it is a lot of work. I just tried it with the FastLED library.
I gave up after 5 or 6 modifications to the FastLED library because there was no end in sight.
If you want the really easy way, use portable installations of IDE 1.8.19 for each modified lvgl library. Note that IDE 1.8.19 might not support all board packages anymore so test that first.
I use it differently but this is the idea
Each directory contains a full installation of IDE 1.8.19. In those directories you need to create a directory portable.
That directory will contain your sketchbook (with libraries) and your board packages. For each portable installation you will need to install the libraries and board packages that you need.
So you can have a portable install for lvgl_mod1 and a portable install for lvgl_mod2 and so on.
If you want to stick to IDE 2.x, you can use the following approach; it's not exactly the same as the portable installation of IDE 1.8.19 but will work (as far as I can see).
The sketchbook location is stored in the file C:\Users\yourUsername\.arduinoIDE\arduino-cli.yaml
You can write a batch / script file that