FastLED WS2811 no lights

Using a Teensy 3.2, WS2811 led strip, and FastLED ver 3.6.0 I get no lights on multiple different demos but the OctoWS2811 rainbow works great with no changes. To confirm
'#define DATA_PIN 8'
would connect to the 9th pin on the board because indexing starts at 0, although I have tried both and still get nothing. I noticed the code line
'const int config = WS2811_GRB | WS2811_800kHz;'
is the 800kHz just a typical led strip I didn't see specific setting for this in FastLED. I am not sure if it is GRB or RBG but I think I should get some lights even if this is wrong.

/// @file    Blink.ino
/// @brief   Blink the first LED of an LED strip
/// @example Blink.ino

#include <FastLED.h>

// How many leds in your strip?
#define NUM_LEDS 60

// For led chips like WS2812, which have a data line, ground, and power, you just
// need to define DATA_PIN.  For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
// Clock pin only needed for SPI based chipsets when not using hardware SPI
#define DATA_PIN 8
int board_light = 13;

// Define the array of leds
CRGB leds[NUM_LEDS];

void setup() { 
  pinMode(board_light, OUTPUT);

      FastLED.addLeds<WS2811, DATA_PIN, GRB>(leds, NUM_LEDS);

     //FastLED.addLeds<WS2811_400, DATA_PIN, RGB>(leds, NUM_LEDS);
    // is there a WS2811_800?
}

void loop() { 
  // Turn the LED on, then pause
  
  for( int i = 0; i < NUM_LEDS; i++)
  {
  leds[i] = CRGB::Red;
  }
  leds[1] = CRGB::Red;
  FastLED.show();
  digitalWrite(board_light, HIGH);
  delay(500);

  digitalWrite(board_light, LOW);
  // Now turn the LED off, then pause
  leds[0] = CRGB::Black;
  FastLED.show();
  delay(500);
}

I realize this would only make the first light in the strip blink, I would be happy with any lights but this non FastLED example works fine

#include <OctoWS2811.h>

const int ledsPerStrip = 100;
const int ledPin = 13;

DMAMEM int displayMemory[ledsPerStrip*6];
int drawingMemory[ledsPerStrip*6];

const int config = WS2811_GRB | WS2811_800kHz;

OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);

int rainbowColors[180];


void setup() {
  
  pinMode(ledPin, OUTPUT);
  
  pinMode(1, OUTPUT);
  digitalWrite(1, HIGH);
  for (int i=0; i<180; i++) {
    int hue = i * 2;
    int saturation = 100;
    int lightness = 50;
    // pre-compute the 180 rainbow colors
    rainbowColors[i] = makeColor(hue, saturation, lightness);
  }
  digitalWrite(1, LOW);
  leds.begin();
}


void loop() {
  digitalWrite(ledPin, HIGH);   // set the LED on
                  
  rainbow(10, 2500);

  digitalWrite(ledPin, LOW);    // set the LED off

  delay(1000);                  // wait for a second
 
}


// phaseShift is the shift between each row.  phaseShift=0
// causes all rows to show the same colors moving together.
// phaseShift=180 causes each row to be the opposite colors
// as the previous.
//
// cycleTime is the number of milliseconds to shift through
// the entire 360 degrees of the color wheel:
// Red -> Orange -> Yellow -> Green -> Blue -> Violet -> Red
//
void rainbow(int phaseShift, int cycleTime)
{
  int color, x, y, wait;

  wait = cycleTime * 1000 / ledsPerStrip;
  for (color=0; color < 180; color++) {
    digitalWrite(1, HIGH);
    for (x=0; x < ledsPerStrip; x++) {
      for (y=0; y < 8; y++) {
        int index = (color + x + y*phaseShift/2) % 180;
        leds.setPixel(x + y*ledsPerStrip, rainbowColors[index]);
      }
    }
    leds.show();
    digitalWrite(1, LOW);
    delayMicroseconds(wait);
  }
}

also I am using 12v ws2811 should a connection between my teensy ground and a ground on my my 12v terminal block be an issue?

Not if it's there. If it's not there, start with that.

it was always there, just wanted to provide more information on my setup most examples I see are 5v strip

1 Like

I have a ws2811 strip using 12vdc. I found FastLED great, if I got it working, so I use Neopixel. I use a resistor on the data pin and 100uf electrolytic capacitor across Vcc and GND... but I think these are just to preserve the WS2811.

The following might be the same as your method ("Red" from inside the library), but this is how I make the color "red":

leds[i] = CRGB(LED_MAX, 0, 0);  // RED

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