i’m trying to compile a slightly modified version of the Noise.ino example in the FastLED library for the Photon board. I’ve the same code up and running on a Teensy 3.1 board, in the Particle Web IDE compilation fails on this line:
FastLED.addLeds<WS2812B,23,RGB>(leds,NUM_LEDS);
When removing it, all compiles fine, when re-inserting it, it fails complaining about not finding a matching template function/call. Is the FastLED version (3.1.4) available in the Web IDE not fully compatible with the stock FastLED library or not fully ported to Particle IDE?
OK, it is a bit odd and I’m not sure why, but as it seems the default zero for the third parameter is not allowed in this constellation of templates.
I know it works fine for “normal” functions, but my C++ is a bit rusty when it comes to templates.
As a workaround just add the third parameter (0) explicitly, the code will still work on Arduino this way.
BTW: How have you declared your pins in lacktable.cpp?
In the candidates notes the template resolution seems to complain about CLK_PIN not being of either unsigned char nor uint8_t.
Could you also show your code that produces that error?
FastLED.addLeds<WS2812B, DATA_PIN, CLOCK_PIN, RGB>(leds,NUM_LEDS); // or with ,0
// or
FastLED.addLeds<WS2812B, DATA_PIN, CLOCK_PIN>(leds,NUM_LEDS); // or with ,0
// or just
FastLED.addLeds<WS2812B>(leds,NUM_LEDS); // or with ,0
And what does the 23 stand for? The Photon has no pin 23!
You are also using NUM_LEDS but have the #define statement commented out.
NUM_LEDS is #defined in line 9 as product of kMatrixWidth * kMatrixHeight - where did you see it commented out? Even when i change the data pin to 1 an try the three variants you proposed, i get the same error… i tried the following function calls:
I see, I had mistaken the green line for a comment and didn’t look close enough
I’m so used to the Visual Studio color scheme.
Since I can’t see the templates the way you posted the code lines above, it’s a bit hard to tell what you did
All three lines look exactly the same - after correcting the formatting for you, the “tags” got displayed.
But the template without pins should at least have given you a different error. Could you have another check if it really was the exact same error with FastLED.addLeds<WS2812B>(leds, NUM_LEDS);? Also try adding the third param there.
OK, I’m trying these too but can’t get it to build either - I’ll report back when I found a way.
I had some tests with your code and the original XYMATRIX sample and I figured that your issue seems to come from your RGB template parameter.
If you substitute it with BGR the code builds.
But why the templates without color encoding scheme fail is still not clear to me.
@happenpappen: Yes of course! I should have seen that earlier.
The problem with RGB is that in the Particle environment there already is an RGB object for the control of the on-board RGB-LED.
Unfortunately the ambiguity should rather trigger a redef or ambiguity error than a cryptic tamplate argument fail, but I guess this is comes from the template deduction happening before the actual compile.
But if you manually remove the ambiguity by writing it this way
Thank you very much for your support! The last hint did the trick. You may see the result of your support here:
This is an Ikea Lack table with integrated a 12x23 WS2812B matrix which now displays the noise example of FastLED. The first version of this table was powered by a Teensy 3.1 without Wifi so to change to another program you had to connect it by USB. The Photon offers much more flexibility to change the program on thy fly.
The WS2812B is a great rgb for dev boards as it runs at 5v and in the case of the photon can run directly off of vin if you are supplying usb power or you can split an outside power supply to support both the strip and photon.