Reputation: 13
I'm trying to understand this line of code.
FastLED.addLeds<WS2812, PIN, GRB>(leds, NUM_LEDS);
It is part of ambilight.ino for Arduino and uses the FastLED library. It seems to be related to the initialization of the led stripe, but I can't understand how the < and > symbols are being used, if they are comparators or somewhat other thing...
I know a bit of coding, but this one is puzzling me.
Cheers.
I don't have many things to try, just want to understand the code.
The code is working correctly, just want to understand it.
Upvotes: 0
Views: 71
Reputation: 56
It is a template, read more about templates here: http://www.cplusplus.com/doc/oldtutorial/templates/
You can see the definition of the template in the FastLed library here: https://github.com/FastLED/FastLED/blob/master/FastLED.h#L390
Upvotes: 2