Multiple LED strips with FastLED on TinyS3 - only one strip works

I am new to the FastLED library and WS2812B LED strips. I am trying to get it to work on a TinyS3 board by Unexpected Maker. However, when using the following example, I can only make one LED strip work at a time:

I am using 8 LED strips and have tried multiple combinations of pins on the TinyS3 (pins 1-3, pins 6-8, etc). Yes, I modified the example to reflect these changes, but no matter what I do, I can only make one LED strip light up at a time. What am I doing wrong?

First of all - show your code rather than example, with YOUR pin numbers specified.
Insert the code in the message using code tags.

I modified my initial message to specify that I modified the example to reflect my configuration - I just changed pin numbers and the LED count. I figured I'd avoid posting too much extra lint, but if you'd prefer me posting the code with those minor changes, I'm happy to include it below.

Using this, only the red LED strip does anything. I've confirmed that all of the LED strips are functional - connecting any of the strips to pin 1 will result in the red array working, but none of the other pins do anything.

#include <FastLED.h>
 
#define NUM_LEDS_PER_STRIP 8
CRGB redLeds[NUM_LEDS_PER_STRIP];
CRGB greenLeds[NUM_LEDS_PER_STRIP];
CRGB blueLeds[NUM_LEDS_PER_STRIP];
 
// For mirroring strips, all the "special" stuff happens just in setup.  We
// just addLeds multiple times, once for each strip
void setup() {
  // tell FastLED there's 8 NEOPIXEL leds on pin 1
  FastLED.addLeds<NEOPIXEL, 1>(redLeds, NUM_LEDS_PER_STRIP);
 
  // tell FastLED there's 8 NEOPIXEL leds on pin 2
  FastLED.addLeds<NEOPIXEL, 2>(greenLeds, NUM_LEDS_PER_STRIP);
 
  // tell FastLED there's 8 NEOPIXEL leds on pin 3
  FastLED.addLeds<NEOPIXEL, 3>(blueLeds, NUM_LEDS_PER_STRIP);
 
}
 
void loop() {
  for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
    // set our current dot to red, green, and blue
    redLeds[i] = CRGB::Red;
    greenLeds[i] = CRGB::Green;
    blueLeds[i] = CRGB::Blue;
    FastLED.show();
    // clear our current dot before we move on
    redLeds[i] = CRGB::Black;
    greenLeds[i] = CRGB::Black;
    blueLeds[i] = CRGB::Black;
    delay(100);
  }
 
  for(int i = NUM_LEDS_PER_STRIP-1; i >= 0; i--) {
    // set our current dot to red, green, and blue
    redLeds[i] = CRGB::Red;
    greenLeds[i] = CRGB::Green;
    blueLeds[i] = CRGB::Blue;
    FastLED.show();
    // clear our current dot before we move on
    redLeds[i] = CRGB::Black;
    greenLeds[i] = CRGB::Black;
    blueLeds[i] = CRGB::Black;
    delay(100);
  }
}

I reached out on the UM Discord channel, and his observation was that I probably needed to use level shifters. I stumbled across this helpful suggestion:

However, even with this little hack, I can still only get the first string of LEDs to work. As a matter of fact, I can only get the first PIN to work - connecting to pins 2 or 3 does nothing. I've tried different pins just for kicks, and no luck. I can set any color on the first string just fine, but I still can't drive more than one string of LEDs or use more than just the lowest-assigned GPIO.

Any thoughts? Maybe a proper level shifter will fix it, but I don't have one handy.

UM had one more suggestion that worked:

Driving the LEDs on an ESP32 is not done via bit banging each pin, like on other platforms, and if you are using the latest 3.0x ESP32 Arduino Core from Espressif, then it's likely there's a bug in the latest FastLED as the RMT peripheral changes drastically between Core 2.x and Core 3.x

I downgraded to Core 2.0.17 and FastLED 3.6.0 (released a few days after that version of the Core). Now, all three strips work just fine.

He did also suggest using the C version of the WS2812 LEDs since they support 3.3V. A rough summary:

  • WS2812A/B versions are only 5V, but 3.3v might work, though YMMV.
  • WS2812C versions can be powered AND driven by 5V OR 3.3V (but don't mix voltages)
  • WS2813X versions are fault-tolerant (losing one LED won't result in the whole strip failing)

I'm using WS2812Bs, and they're working just fine being powered by 5V and driven by 3.3V. Since I'm only driving strips of 8 LEDs, I'm going to hold my breath.

Thanks!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.