Hi all - as I only really do this at Xmas,

Hi all - as I only really do this at Xmas, I’m forgetting some basics and require some assistance.

I’ve some 5m APA102 strips which both work, however only for the first meter or so.

All of the rest of the lights still light up, but with nonsense. Because they light up, I’m guessing it’s maybe not a power issue?

Does anyone have any pointers?

Thanks!

Do not guess about the power, use a voltmeter and actually check at various points in your strip that your 5V is not below 4.5V

Also try a lower data frequency. It has ben a reported problem by many here that longer strip lengths do not behave well with higher data frequencies.

In fact, @PaulStoffregen just did a writeup on why the APA102’s do this - https://www.pjrc.com/why-apa102-leds-have-trouble-at-24-mhz/

Thanks Daniel/JP - the voltage was fine as I suspected. Now it all works with the speed explicitly set to 6.

@Daniel_Garcia - the only issue for me now is that this set has a BGR colour order. I’ve tried “#define COLOR_ORDER BGR”, but it’s not recognised. Is there another way to set this correctly?

@Mark_Ortiz Color order can be set in the following line…

FastLED.addLeds<APA102, BGR>(leds, NUM_LEDS);

Hi JR - yes, but when I try BGR that I get a compilation error that I don’t get with RGB nor GRB:

In file included from C:\Users\marke\Documents\Arduino\libraries\FastLED/FastLED.h:51:0,

             from D:\Programming\Arduino Dev\XmasLights2017_IRRemote_APA102_300\XmasLights2017_IRRemote_APA102_300.ino:4:

C:\Users\marke\Documents\Arduino\libraries\FastLED/fastpin.h: In instantiation of ‘class FastPin<136u>’:

C:\Users\marke\Documents\Arduino\libraries\FastLED/fastspi_bitbang.h:23:50: required from ‘class AVRSoftwareSPIOutput<0u, 136u, 7u>’

C:\Users\marke\Documents\Arduino\libraries\FastLED/fastspi.h:30:7: required from ‘class SPIOutput<0u, 136u, 7u>’

C:\Users\marke\Documents\Arduino\libraries\FastLED/chipsets.h:94:6: required from ‘class LPD8806Controller<0u, 136u, (EOrder)10u, 7u>’

C:\Users\marke\Documents\Arduino\libraries\FastLED/FastLED.h:236:66: required from ‘static CLEDController& CFastLED::addLeds(CRGB*, int, int) [with ESPIChipsets CHIPSET = (ESPIChipsets)5u; unsigned char DATA_PIN = 0u; unsigned char CLOCK_PIN = 136u]’

D:\Programming\Arduino Dev\XmasLights2017_IRRemote_APA102_300\XmasLights2017_IRRemote_APA102_300.ino:401:67: required from here

C:\Users\marke\Documents\Arduino\libraries\FastLED/fastpin.h:206:2: error: static assertion failed: Invalid pin specified

static_assert(validpin(), “Invalid pin specified”);

Well, this issue is above my pay grade. I would suggest post your entire sketch on gist and provide a link to it here also add all relevant info like controller used version of Arduino etc… etc…

Mark - at least post your addLeds line, if not your entire setup method - it’s kind of an important part of telling you why there are compilation errors. (Also, it is possible that if you are explicitly setting the data rate and the color order that you need to explicitly set the clock and data pin, even if using hardware SPI)

delay(3000); // power-up safety delay
FastLED.addLeds<CHIPSET, DATA_PIN, CLOCK_PIN, COLOR_ORDER, DATA_RATE_MHZ(CHIP_SPEED)>(leds, NUM_LEDS);
FastLED.addLeds<CHIPSET, 0, COLOR_ORDER>(fakeLEDsFB[0], NUM_LEDS); //Fake LEDs
FastLED.addLeds<CHIPSET, 0, COLOR_ORDER>(fakeLEDsFB[1], NUM_LEDS); //Fake LEDs

with these at the top:
#define CLOCK_PIN 53
#define DATA_PIN 51
#define NUM_LEDS 324
#define CHIPSET APA102
#define COLOR_ORDER BGR
#define CHIP_SPEED 6

Like I say, RGB and GBR works so it would be strange to me that the other settings affect it compiling. The FakeLEDs are for dummy non-existent lights that I use for visual echo effect type processing.

Thanks for any help! But if no joy, I’ll just swap R and B elsewhere…

Yeah - your fake leds are the problem - and it’s a quirk of math that some color orders work and some don’t. You need to define both a fake data pin and a fake clock pin for that.

Thanks… almost, but still doesn’t compile. Now it says that one of my IR codes is not declared in this scope! (also for RGB). Propbably easier to change the rest of my code and put it back to the way it was. Thanks anyway.

FastLED.addLeds<CHIPSET, DATA_PIN, CLOCK_PIN, COLOR_ORDER, DATA_RATE_MHZ(CHIP_SPEED)>(leds, NUM_LEDS);
FastLED.addLeds<CHIPSET, 40, 41, COLOR_ORDER, DATA_RATE_MHZ(CHIP_SPEED)>(fakeLEDsFB[0], NUM_LEDS);
FastLED.addLeds<CHIPSET, 30, 31, COLOR_ORDER, DATA_RATE_MHZ(CHIP_SPEED)>(fakeLEDsFB[1], NUM_LEDS);

Scratch that - must have been overzealous with editing. I did it all again and it works. Thanks for all your help! :slight_smile: