focalintent / FastLED-Sparkcore

SparkCore specific port of FastLED
MIT License
24 stars 34 forks source link

RGB seems to be invalid EOrder #7

Closed ryantuck closed 8 years ago

ryantuck commented 8 years ago

I've got LPD8806 strips and a photon that I'm playing around with.

I attempted to use the FirstLight.ino example sketch. My setup() looked like this:

void setup() {
    delay(2000);
    FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
}

But I was seeing errors like the following:

FastLED/FastLED.h:177:129: note:   template argument deduction/substitution failed:
firstlight.cpp:54:72: error: template argument 4 is invalid

After banging my head against the wall for a while, I decided on a whim to change the color ordering to some other combination, compiled the code, and it worked!

void setup() {
    delay(2000);
    FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, BRG>(leds, NUM_LEDS);
}

It turns out all other color combinations except for RGB work. Seems wild that this would be the case, given the way EOrder is defined:

// Define RGB orderings
enum EOrder {
    RGB=0012,
    RBG=0021,
    GRB=0102,
    GBR=0120,
    BRG=0201,
    BGR=0210
};

This is using v 3.1.4. Fortunately my strips are BRG so I can go about my business, but wanted to give a heads up.

focalintent commented 8 years ago

When using the RGB ordering you have to explicitly say EOrder::RGB (or something along those lines - it might be NSFastLED::RGB) - this is because there's something in the photon library that defines RGB which breaks this usage.

Not a whole lot that I can do about it at the moment (without re-writing the rgb ordering stuff)