I'm trying to connect 2 APA102 LED strips to my Pi3 b+. Each stript contains 2 RGB leds in order to do a simple POC without external power source. My goal is to drive the 2 strips independent of each other
So far, i got a single strip working by connecting by connecting SPI0 MOSI to led strip DI, and SPI0 SCLK to led strip CI. schema:
I'm able to control the leds on this strip through NodeJS, relevant code snippet:
Now i want to connect a second strip, and drive it through SPI1 MOSI and SPI1 SCLK like so:
Code: Select all
// node js libs var Apa102spi = require('apa102-spi'); var rpio = require('rpio'); ... // number of leds, clock divider this.LedDriver = new Apa102spi(2, 100); .. // set led: index, brightness, r g b this.LedDriver.setLedColor(0, 10, 0, 0, 255); // write to strip this.LedDriver.sendLeds();
The assumption is that this way, I can control both strips independantly from the Pi by selecting output channel (SPI0 MOSI or SPI1 MOSI), e.g. (pseudo code):
I cant seem to get this working. I'm new to the raspberry Pi/GPIO, and i can't find any example of connecting two SPI led strips this way. I have the following questions:
Code: Select all
// number of leds, clock divider, data pin this.LedDriver1 = new Apa102spi(2, 100, SPI0_MOSI); this.LedDriver2 = new Apa102spi(2, 100, SPI1_MOSI); ... this.LedDriver1.setLedColor(0, 10, 0, 0, 255); this.LedDriver2.setLedColor(0, 10, 255, 0, 0);
1. Is the second schema/wiring example setup correct?
2. Are there any examples or tutorials for connecting 2 strips this way? Programming language is not important; Node JS would be ideal, but I should be able to figure it out if it's another language.
3. Any reading materials/links/information is welcome!
This is my first Raspberry project and my first message on this forum, so please forgive me my n00bischness