Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Daisy chaining RGB and RGBW strips
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Daisy chaining RGB and RGBW strips

by AnasMalas on Wed Sep 02, 2020 7:20 am

Hello! I am designing a project right now that will involve about 120 RGBW neopixels, as well as 60 RGB ones. This will run on a daughter board I am designing with the atmega 32u4, which will run the Arduino bootloader to manage everything and get its orders from a raspberry PI. The project calls for 2 PWM pins for fan control, and 1 PWM pin for a constant current LED driver, so I am a little afraid that taking two more pins for the two strip types could cause issues with timers and all, and I need this system to run without any major issue for a while, and using just one pin seems less risky.

I know that the amount of bits are different for each neopixel, but I fail to see how an RGB led will know that it is carrying code for an RGBW one further along, so what is stopping me from sending 60 LEDs worth of 3 colors, and 120 LEDs worth of 4 colors?

Say this is not possible, can I use a hack? Perhaps I can treat the 60 RGB LEDs as 45 RGBW LEDs and just sent the data this way? 4 Leds would become 3 in the code, with the colors (RGBR)(GBRG)(BRGB), then it repeats, would that work? or do the LEDs have some sort of a stop and start bit that would stop this from happening?

I need to know this information before I order, so that I can know if I need to go with an atmega 2560, so thanks a bunch for any help!

AnasMalas
 
Posts: 3
Joined: Wed Sep 02, 2020 7:05 am

Re: Daisy chaining RGB and RGBW strips

by adafruit_support_bill on Wed Sep 02, 2020 7:37 am

Yes, it is possible to daisy-chain the two different strip types and the data will be passed through transparently. You would just need to 'massage' the pixel data as you describe to re-map the color channels on the downstream pixels.

adafruit_support_bill
 
Posts: 79114
Joined: Sat Feb 07, 2009 10:11 am

Re: Daisy chaining RGB and RGBW strips

by AnasMalas on Thu Sep 03, 2020 3:34 am

Thank you for the quick reply!

adafruit_support_bill wrote:You would just need to 'massage' the pixel data as you describe to re-map the color channels on the downstream pixels.

Just to make sure, you mean this method, right? The library does not support mixed strings?
AnasMalas wrote:4 Leds would become 3 in the code, with the colors (RGBR)(GBRG)(BRGB), then it repeats

AnasMalas
 
Posts: 3
Joined: Wed Sep 02, 2020 7:05 am

Re: Daisy chaining RGB and RGBW strips

by adafruit_support_bill on Thu Sep 03, 2020 5:56 am

The library does not support mixed strings. You would need to do the 4 to 3 mapping in your code.

adafruit_support_bill
 
Posts: 79114
Joined: Sat Feb 07, 2009 10:11 am

Re: Daisy chaining RGB and RGBW strips

by AnasMalas on Sun Sep 06, 2020 3:36 am

I borrowed a small bar of Add. leds from a friend, I dont quite know which type they are, but the following awful test code I made worked well, so I guess now im off to make it better

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_NeoPixel.h>
#define LED_PIN     3
#define LED_COUNT  12
#define BRIGHTNESS 100

// This awful code needs it to be RGBW, if you want GRBW, youll have to change the d4pixels function
// not that it matters, youll be able to input your LED data as RGB RGB RGB RGB, in pairs of 4.
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_RGBW + NEO_KHZ800);

void setup() {
  strip.begin();           // INITIALIZE NeoPixel strip object (REQUIRED)
  strip.show();            // Turn OFF all pixels ASAP
  strip.setBrightness(BRIGHTNESS); // Set BRIGHTNESS to about 1/5 (max = 255)
}

void loop() {
    d4pixels(255,0,0,255,0,0,255,0,0,255,0,0,0); // (R G B  R G B  R G B  R G B  Pin)
    d4pixels(0,255,0,0,255,0,0,255,0,0,255,0,3);
    d4pixels(0,0,255,0,0,255,0,0,255,0,0,255,6);
    d4pixels(255,255,255,255,255,0,0,255,255,255,0,255,9);
    strip.show(); //  Update strip 4 red, 4 blue, 4 gree, 1 white, 1 yellow, 1 cyan, 1 magenta
    delay(500);
}

void d4pixels(int r1,int g1,int b1, int r2,int g2,int b2, int r3,int g3,int b3, int r4,int g4,int b4, int ledPos)
{
  strip.setPixelColor(ledPos, strip.Color(g1,r1,b1,g2));
  strip.setPixelColor(ledPos+1, strip.Color(r2,b2,g3,r3));
  strip.setPixelColor(ledPos+2, strip.Color(b3,g4,r4,b4));
}

AnasMalas
 
Posts: 3
Joined: Wed Sep 02, 2020 7:05 am

Please be positive and constructive with your questions and comments.