How to use different lib versions with same name in one project?

Hi,

I want to use two different versions of one library in one project.
The libs are:
official FastLED: PlatformIO Registry
inofficial Fork for RGBW: GitHub - coryking/FastLED: The main FastLED library (successor to FastSPI_LED). Please direct questions/requests for advice to the g+ community - http://fastled.io/+ - we'd like to keep issues to just tracking bugs/enhancements/tasks. *NOTE* library work is currently on hold - see https://plus.google.com/102282558639672545743/posts/JQKcujjaXXC for details.

I defined different enviroments like this:


[env:d1_mini_rgb]
   [..]
lib_deps =
     FastLED

[env:d1_mini_rgbw]
   [..]
lib_deps =
     FastLED_RGBW=git@github.com:coryking/FastLED.git
  1. I hoped the alternative library would be installed to .piolibdeps\FastLED_RGBW\ instead of .piolibdeps\FastLED\
  2. But even if it did, I think #include <FastLED.h> would still call the official library, right?

I would like to use something like this:

[env:d1_mini_rgbw]
build_flags = -D RGBW
lib_deps =
     FastLED_RGBW=git@github.com:coryking/FastLED.git
#ifdef RGBW
   #include <FastLED_RGBW/FastLED.h>
#else
  #include <FastLED.h>
#endif

So, how do I do this the right way?
Or do I have to use different project folders where only one FastLED exists?

1 Like

lib_extra_dirs is the config option you want.

Don’t use the ‘lib’ dir. Make lib1, lib2, … in your project folder. Under your board settings use ‘lib_extra_dir = lib1’ and so on.

This is a bug and has been just fixed

1 Like