Getting WS2811 to run with Teensy 3.6

Status
Not open for further replies.

sixeight

Well-known member
I have connected a WS2811 chip to a Teensy 3.6 to control my RGB display backlight. I was really struggling to get it to work. Initially the RGB would turn on, but after that the command to change the colour was ignored.

The solution that made it work was to change Optimize in the Arduino IDE from "Faster" to "Fast". I would like to know why this solution worked. Is there a problem with the "Faster" optimization?

Here is my code:
Code:
#include <Adafruit_NeoPixel.h>
#include <avr/power.h>

#define NEO2_PIN 2

Adafruit_NeoPixel Backlight = Adafruit_NeoPixel(1, NEO2_PIN, NEO_RGB + NEO_KHZ400);

void setup() {
  Backlight.begin();
  Backlight.setPixelColor(0, 255, 0, 0); // Change colour to red
  Backlight.show();
}

The WS2811 is connected via a 4k7 resistor to pin 2 of the Teensy. The WS2811 and the display are powered by 5V. There is a 100n capacitor close to the WS2811 to clean up the power.
 
Status
Not open for further replies.
Back
Top