Skip to content

Multiple strands with clock #760

Closed
Closed

Description

@JanBosNL

Hello Eye candy lovers...

I am trying to get multiple strands of leds to work with 1 esp8266 controller. However the fastled library examples all use 3 line (GND/VCC/DATA) strips.

Is it possible at all to get 2 or 3 strips of APA102 to work on 1 esp8266? When they need 4 lines (GND/VCC/DATA/CLCK) ? And is it possible to combine completely different strips? I would eventually like to combine the APA102 strips with SK6812 WWA strips to have interactive modes of lighting when movement is detected from a pir sensor...

So 1 strip stays in its routine and another starts another routine etc....

For now though, just getting the 2 strips APA102 30 leds per strip strip on pin 12 strip and on pin 13 and both their clocks on pin 14 is not working out for me.

Anybody here have experience with this and can point me in the wright direction?

Any suggestions with some simple code to actually get both of them blinking would be a good start....

Activity

  1. JanBosNL commented on Mar 21, 2019

    @JanBosNL
    Author

    P.s. I tried this code:

    #include "FastLED.h"
    #define NUM_STRIPS 2
    #define NUM_LEDS_PER_STRIP 30
    #define CLK_PIN     14
    #define LED_TYPE      APA102
    #define COLOR_ORDER   BGR
    CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];
    
    void setup() {
      FastLED.addLeds<APA102, 12>(leds[0], NUM_LEDS_PER_STRIP);
      FastLED.addLeds<APA102, 13>(leds[1], NUM_LEDS_PER_STRIP);
      //FastLED.addLeds<NEOPIXEL, 12>(leds[2], NUM_LEDS_PER_STRIP);
    
    }
    
    void loop() {
      // This outer loop will go over each strip, one at a time
      for(int x = 0; x < NUM_STRIPS; x++) {
        // This inner loop will go over each led in the current strip, one at a time
        for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
          leds[x][i] = CRGB::Red;
          FastLED.show();
          leds[x][i] = CRGB::Black;
          delay(100);
        }
      }
    } 
    
  2. JanBosNL commented on Mar 22, 2019

    @JanBosNL
    Author

    Okay, I managed to get some stuf working..

    A simple test here:

    #include "FastLED.h"
    #define DATA_PIN_A  12
    #define DATA_PIN_B  13
    #define CLK_PIN  14
    #define LED_TYPE  APA102
    #define COLOR_ORDER  BGR
    #define NUM_LEDS  30 // per strand
    CRGB leds_A [NUM_LEDS];
    CRGB leds_B [NUM_LEDS];
    
    void setup() {
      delay(3000); // 3 second delay for recovery
      FastLED.addLeds<LED_TYPE,DATA_PIN_A,CLK_PIN,COLOR_ORDER>(leds_A, NUM_LEDS).setCorrection(TypicalLEDStrip);
      FastLED.addLeds<LED_TYPE,DATA_PIN_B,CLK_PIN,COLOR_ORDER>(leds_B, NUM_LEDS).setCorrection(TypicalLEDStrip);
      FastLED.setBrightness(96);
    }
    
    void loop() { 
      // Fill leds with rainbow
      fill_rainbow(leds_A, NUM_LEDS, millis());
      FastLED.show();
      delay(2000);
    
      fill_solid(leds_B, NUM_LEDS, CRGB::Yellow);
      FastLED.show();
      delay(2000);
    
      // Turn leds off
      fill_solid(leds_A, NUM_LEDS, CRGB::Black);  // Set all leds black
      FastLED.show();
      delay(1000);
      // Turn leds off
      fill_solid(leds_B, NUM_LEDS, CRGB::Black);  // Set all leds black
      FastLED.show();
      delay(1000);
      
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions