Teensy-LC & Fastled

Status
Not open for further replies.

Pointy

Well-known member
I am probably doing something stupid but I can't seem to get my LEDs working correctly.

I have a 120 LED strip of WS2812B's connected to the Teensy-LC pin 17 (on right hand side of board) powered from an external source with the grounds connected.

I am using Arduino 1.6.5 r2 and Teensyduino 1.24 Beta #3.

When I run the fastled>blink example the first LED blinks once only and if I use the following code to try and do a running LED only the first LED flashes once.

Code:
#include "FastLED.h"

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

// For led chips like Neopixels, 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
#define DATA_PIN 17
#define CLOCK_PIN 13

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

void setup() { 
      // Uncomment/edit one of the following lines for your leds arrangement.
      // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
       FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
      // FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
      // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<UCS1903B, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<GW6205, DATA_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<GW6205_400, DATA_PIN, RGB>(leds, NUM_LEDS);
      
      // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);

      // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
      // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
}

void loop() {
        for(int dot = 0; dot < NUM_LEDS; dot++) { 
            leds[dot] = CRGB::Blue;
            FastLED.show();
            // clear this led for the next time around the loop
            leds[dot] = CRGB::Black;
            delay(30);
        }
    }

Please tell me what I am missing?

Regards,

Les
 
Maybe try testing with the Adafruit_NeoPixel library?

That could at least help establish if you have a hardware or software problem.
 
Please show us your circuit. How are you powering the Teensy 3LC - USB or external power supply? Have you cut the power trace on the bottom-side of the Teensy? What are the details of "powered from an external source"? Are you using any filter capacitors on the power to the Teensy?

You might try also with just a few LED pixels.

I don't see any issues with your code, so I suspect it's something with the circuit. But since the circuit is kinda trivial, that's got me wondering about power.
 
Please show us your circuit. How are you powering the Teensy 3LC - USB or external power supply? Have you cut the power trace on the bottom-side of the Teensy? What are the details of "powered from an external source"? Are you using any filter capacitors on the power to the Teensy?

You might try also with just a few LED pixels.

I don't see any issues with your code, so I suspect it's something with the circuit. But since the circuit is kinda trivial, that's got me wondering about power.

I don't think it's a power issue. The LEDs are connected to my 10amp bench supply, with the Teensy being powered by USB. The Teensy ground is connected to the PSU/LED ground. Everything works nicely when I choose 24Mhz CPU speed and recompile.

You'd think so. Maybe it's a bug in FastLED? Might be worth reporting to Daniel & Mark...

Thanks Paul, I'll drop them a message.

Maybe someone else with a Teensy-LC and some WS2812Bs can confirm it's not something my end?

Regards,

Les
 
Pointy, I was using the Teensy LC fasted branch. has this branch now been incorporated into the main repository? I only used with ws2811, not ws2812B, sorry, have none to test.
 
Pointy, I was using the Teensy LC fasted branch. has this branch now been incorporated into the main repository? I only used with ws2811, not ws2812B, sorry, have none to test.

I am not sure as this is my first attempt at using both the Teensy-LC and Fastled, but I think the version included with Teensyduino is 3.1.

I was going to report it as a potential bug but as they are using google+ communities and I detest it, I won't bother. (I am not sure if the CPU speed is going to cause any other issues, but at least it is working for now)

Regards,

Les
 
You could always report bugs on the github tracker for the library - http://fastled.io/issues - make sure you've grabbed the latest pull of the FastLED3.1 branch - I did a bunch of major work for the teensy-lc (and other cortex m0 arm chipsets) a couple weeks ago, it'll go over to master in the next couple of weeks.
 
Just re-ran with FastLED3.1 latest checkout, arduino 1.6.5 and Teensyduino 1.24 -- works for both 24 and 48mhz clock rates, optimized and non-optimized.
 
You could always report bugs on the github tracker for the library - http://fastled.io/issues - make sure you've grabbed the latest pull of the FastLED3.1 branch - I did a bunch of major work for the teensy-lc (and other cortex m0 arm chipsets) a couple weeks ago, it'll go over to master in the next couple of weeks.

Thanks, I wasn't sure if it was a bug or a problem my end.

Just re-ran with FastLED3.1 latest checkout, arduino 1.6.5 and Teensyduino 1.24 -- works for both 24 and 48mhz clock rates, optimized and non-optimized.

Using the latest branch fixes the problem. Thanks for the reply.

Regards,

Les
 
Thanks for the followup. That really helps, confirming the new branch works.

I'm getting ready for a first 1.25 beta. I've updated the FastLED copy that will ship with 1.25 to the new branch. :)
 
Status
Not open for further replies.
Back
Top