Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 10 of 10

Thread: Eliminate LED fast flickering from PWM breakout board and Teensy 3.6

Threaded View

  1. #1

    Eliminate LED fast flickering from PWM breakout board and Teensy 3.6


    This is a follow up to a previous post:

    I am trying to get more digital outputs from a teensy 3.6 for some RGB LED button switches I’m using. So I am using a PWM breakout board. Right now I hooked up 4 of the switches and the LEDs are flickering really fast. It’s kind of annoying and I would like to eliminate this so that they look more solid.

    Here is a link to the button switches I’m using:

    Here is the PWM breakout board I’m using. I’m sure some of you have used it as it seems pretty popular:


    I am using Vin to power the breakout board. I am using the Teensy digital pins 30, 29 and 28 for Data, Clock and Latch. From the breakout board I tried powering the LEDs with just one wire from the board (V+), then I tried using 4 of these wires, thinking it would make the LEDs flicker less, but that didn’t work.

    Any ideas on how to eliminate this flickering?

    Also, i accidentally used Analog outs once and the LEDs looked way brighter, which was way more prefferable. Is there a way to make these things brighter as well? Or maybe that is part of the problem, in that if they are brighter I won’t see the flickering.

    I am not using any resistors or capacitors. I tried putting a big capacitor between Vin and Ground on the breadboard coming from the Teensy and it didn’t do anything.

    I added an extra tlc.write(); at the end of the code because a friend suggested that it would help. It actually did minimize the flickering a little bit, but it’s still there.

    Also, I tried adding a delay between the 2 lines of tlc.write();

    So like this:


    And it really helped but didn't totally eliminate the flickering. I think what I am seeing is the actual modulations of the pulse width. I don't want any delays in my final code however.

    Also, just for your information, I will be ultimately be using this as a MIDI controller and these LEDs will need to be changing colors all the time. I think that's possible if I code it correctly, but if that’s not correct with this PWM breakout board method please let me know.

    Below is the code I am using for my testing/prototyping now.

    Thank You. Nick

    #include "Adafruit_TLC5947.h"
    // How many boards do you have chained?
    #define NUM_TLC5974 1
    #define data   30        // digital pins on the Teensy
    #define clock   29
    #define latch   28
    #define oe  -1  // set to -1 to not use the enable pin (its optional)
    Adafruit_TLC5947 tlc = Adafruit_TLC5947(NUM_TLC5974, clock, data, latch);
    void setup() {
      Serial.println("TLC5974 test");
      if (oe >= 0) {
        pinMode(oe, OUTPUT);
        digitalWrite(oe, LOW);
    void loop() {
      // how you set LED colors for individual LEDs
      tlc.setLED(0, 255, 0, 0);    // (LED number, R value, G value, B value)
      tlc.setLED(1, 226, 255, 3);
      tlc.setLED(2, 255, 255, 255);
      tlc.setLED(3, 0, 0, 255);
    Last edited by nicnut; 02-13-2020 at 06:49 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts