Daisy chain LED bars

Is it possible to daisy chain two LED bars, using only one digital port? I have two Grove LED bars (<LINK_TEXT text=“https://www.seeedstudio.com/Grove-LED-B … -2474.html”>https://www.seeedstudio.com/Grove-LED-Bar-v2-0-p-2474.html</LINK_TEXT>)… I can hook them up to separate digital ports (eg D7 and D8), but instead I’d like to do this:

  • Use only one digital port
  • Go from D8 on the Grove shield into one LED bar
  • Connect GND, VCC, DCKO, and DO, into GND, VCC, DCKI, and DI of the second LED bar
  • In my code, make only one call to bar.setBits(value)



    Is this possible? When I tried this, the LEDs on both LED bars were synced up and matched each other. In other words, when I called

    bar.setBits(0b0000011111);

    …the first 5 LEDs on both LED bars were lit (and the remaining LEDs were off). I was expecting the first 5 LEDs to be lit only on the first LED bar. So is it possible to daisy chain multiple LED bars, and control their LEDs independently?

Hi there,



You can chain Grove - LED Bars by connecting DO, DCKO, VCC, GND to another LED bar’s DI, DCKI, VCC, GND. But seems library in Seeed Wiki only can used with one LED bar, I wrote a new library to you. Please download the following files:



<LINK_TEXT text=“https://raw.githubusercontent.com/Seeed … r/LEDBar.h”>https://raw.githubusercontent.com/SeeedDocument/Projects/master/led_bar/LEDBar.h</LINK_TEXT>

<LINK_TEXT text=“https://raw.githubusercontent.com/Seeed … LEDBar.cpp”>https://raw.githubusercontent.com/SeeedDocument/Projects/master/led_bar/LEDBar.cpp</LINK_TEXT>



and put them to your project folder, let it looks like this:




[code]
#include “LEDBar.h”

LEDBar bar(9, 8, 2);

void setup() {
bar.begin();
}

void loop() {
bar.setBits(0x01f);
}
[/code]

The code above can make two LED bars looks like this:







Best Regards,

Blu