andyg
July 28, 2020, 5:56am
1
Hi everyone,
I am trying to use the FastLED2 library with the web GUI
// This #include statement was automatically added by the Particle IDE.
#include <FastLED2.h>
void setup(){}
void loop(){}
However i get the following from the get go.
apatest.ino:2:22: FastLED2.h: No such file or directory
Where am i going wrong?
AFAICT there actually is no FastLED2.h
in that library.
But there is a FastLED.h
.
However, from your project name apatest.ino
I guess you want to control APA102 LEDs and for those I would not use any library but HW SPI with a few lines of custom code as they are really simple to control.
This was a very simple test project of mine (the actual APA102 stuff is ~10 lines of that entire project)
https://go.particle.io/shared_apps/5a32bb93f21315684d0000f7
andyg
July 28, 2020, 7:06am
3
Thanks for this suggestion, I will study it.
But at this time I would like to utilise the extensive library of pre-buit FastLED effects.
So just trying to get FastLED2 working.
If I change FastLED2.h to FastLED.h. none of the examples in the FastLED2 library compile.
thx
Which samples have you tested?
I tried ArrayOfLedArrays
and that built just fine (and it does in fact use FastLED.h
).
What errors do you see?
Can you post a SHARE THIS REVISION link to one of your not-building samples?
andyg
July 28, 2020, 8:56am
5
Hi, I tried DemoReel100.ino
https://go.particle.io/shared_apps/5f1fe75dfb925e0016ffc56e
with the following errors:
apatest.ino:6:18: variable or field ‘addGlitter’ declared void
apatest.ino:6:18: ‘fract8’ was not declared in this scope
This is a namespacing error.
Just got to the definition of void addGlitter(fract8 chanceOfGlitter)
and change that to
void addGlitter(::fract8 chanceOfGlitter)
or fully qualified
void addGlitter(NSFastLED::fract8 chanceOfGlitter)
1 Like
andyg
July 28, 2020, 11:52am
7
Its compiling now - thank you!!
I changed to APA102 and still compiling.
but not sure of the correct pins?
#define DATA_PIN D3
#define CLK_PIN D4
#define LED_TYPE APA102
https://go.particle.io/shared_apps/5f2010b0e83d020016459011
I don’t think the library is using the HW SPI (with its DMA capabilities) so you are free to chose whatever pins you want.
With HW SPI you would use A3 & A5 for SPI or D4 & D2 for SPI1.
1 Like
andyg
July 28, 2020, 6:13pm
9
I am pleased to confirm that it working on A3 & A5 so could be using SPI?
Thanks very much for your guidance.
system
Closed
September 26, 2020, 6:13pm
10
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.