GRB Serial Input (TouchDesigner) to Teensy 4.1 to WS2812B strips (6)

novacult.wav

New member
END GOAL:
Replace the Arduino Uno R3 in my LED setup with the Teensy 4.1 to extend my working 40pixels per strip (6 strips total) to be able to handle 140 pixels per strip.

THE LAST BEST STATE:
I was able to send GRB values from Touchdesigner to my Arduino Uno R3 and successfully get 6 strips to light up 40 of their 140 pixels to produce my TD animations over Serial at an 115200 baud rate. As I'd increase the pixel count per strip, that's when the animation would glitch and show the wrong colors more and more out of order, etc. ( seemingly to the low baud rate).

It's my understanding that Teensy 4.1 can manage a higher baud rate and thus more pixels, allowing me to run 6 strips at 140 pixels per strip.

I've replaced the Arduino Uno R3 with the Teensy 4.1 and have been able to get Teensy animations like "Blink" to work fine with the native LED on the Teensy.
But the moment I try to output from the pins, I don't get any light from my strips (I'm hoping for obvious reasons to someone here, Paul? haha)

Admittedly, I am much more a hobbyist at this (more on the music side of things) and while I've gotten fairly comfortable with the Arduino, I really feel in the weeds here and wish I wasn't posting in the forum in such desperation (there's likely to be some noob mistakes, seemingly on the hardware end?).

I've tried implementing the OCTOWS2811 library (which, it's my understanding still works with WS2812B LEDs) mixed with the FastLED library (thanks for the heads up, Lucas Morgan), but feel mixed up with whether to use LEDS.addLEDS... or FastLEDS.addLEDS... or whether it's a separate issue altogether.

It seems like the best bet ultimately is to implement the physical OCTOWS11 Adaptor and solder ethernet connections to my strips. But I didn't want to commit to that until I've made sure it's not just my code/hardware implementation. (it's my understanding, you don't necessarily need the physical adaptor, it+ethernet just speeds things up).

I've attached some reference photos along with my code below. I can upload new photos as needed, just wanted to get the conversation started.

My working Arduino Code (please see my latest non-working version for the Teensy further down):

Code:
#include<FastLED.h>

#define NUM_LEDS_PER_STRIP 40
#define NUM_STRIPS 1

  #define LED_TYPE  WS2812B
  #define COLOR_ORDER   GRB
  #define DATA_PIN1       3   // LED 01
  #define DATA_PIN2       5   // LED 02
  #define DATA_PIN3       6   // LED 03
  #define DATA_PIN4       9   // LED 04
  #define DATA_PIN5      10   // LED 05
  #define DATA_PIN6      11   // LED 06
 
  #define BRIGHTNESS     80
  #define VOLTS           5
  #define MAX_MA       8000
 
CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
const int numOfBytes = NUM_LEDS_PER_STRIP * NUM_STRIPS * 3;
const int numLeds = NUM_LEDS_PER_STRIP * NUM_STRIPS;
char inputBuffer[numOfBytes];

void setup() {
  FastLED.addLeds<LED_TYPE, DATA_PIN1, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP)
    .setCorrection(TypicalLEDStrip)
    .setDither(BRIGHTNESS < 255);
  FastLED.addLeds<LED_TYPE, DATA_PIN2, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP)
    .setCorrection(TypicalLEDStrip)
    .setDither(BRIGHTNESS < 255);
  FastLED.addLeds<LED_TYPE, DATA_PIN3, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP)
    .setCorrection(TypicalLEDStrip)
    .setDither(BRIGHTNESS < 255);
  FastLED.addLeds<LED_TYPE, DATA_PIN4, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP)
    .setCorrection(TypicalLEDStrip)
    .setDither(BRIGHTNESS < 255);
  FastLED.addLeds<LED_TYPE, DATA_PIN5, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP)
    .setCorrection(TypicalLEDStrip)
    .setDither(BRIGHTNESS < 255);
  FastLED.addLeds<LED_TYPE, DATA_PIN6, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP)
    .setCorrection(TypicalLEDStrip)
    .setDither(BRIGHTNESS < 255);
    
  FastLED.setBrightness(BRIGHTNESS);
  delay(500);
  Serial.begin(115200);
  FastLED.clear();
  FastLED.show();
  Serial.println("Ready to receive colors."); 
}

void loop() {
  if(Serial.available() > 0) {
    Serial.readBytes(inputBuffer, numOfBytes);
  }
  for (int j = 0; j < numLeds; j++) {
    leds[j] = CRGB(inputBuffer[(j*3)],inputBuffer[(j*3)+1],inputBuffer[(j*3)+2]);
  }
  FastLED.show();
}


This is where I last left off with the Teensy code:
Code:
#define USE_OCTOWS2811
#include<OctoWS2811.h>
#include "Arduino.h"
#define FASTLED_INTERNAL
#include <FastLED.h>

#define NUM_LEDS_PER_STRIP 40
#define NUM_STRIPS 6

  #define LED_TYPE  WS2812B
  #define COLOR_ORDER   GRB
  #define DATA_PIN1       3   // LED 01
  #define DATA_PIN2       5   // LED 02
  #define DATA_PIN3       6   // LED 03
  #define DATA_PIN4       9   // LED 04
  #define DATA_PIN5      10   // LED 05
  #define DATA_PIN6      11   // LED 06

  #define BRIGHTNESS     80
  #define VOLTS           5
  #define MAX_MA       8000

CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];
const int numOfBytes = NUM_LEDS_PER_STRIP * NUM_STRIPS * 3;
const int numLeds = NUM_LEDS_PER_STRIP * NUM_STRIPS;
char inputBuffer[numOfBytes];

void setup() {
  LEDS.addLeds<OCTOWS2811>(leds, NUM_LEDS_PER_STRIP);

  pinMode(DATA_PIN1, OUTPUT);
  pinMode(DATA_PIN2, OUTPUT);
  pinMode(DATA_PIN3, OUTPUT);
  pinMode(DATA_PIN4, OUTPUT);
  pinMode(DATA_PIN5, OUTPUT);
  pinMode(DATA_PIN6, OUTPUT);

//  LEDS.addLeds<LED_TYPE, DATA_PIN1, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP)
//    .setCorrection(TypicalLEDStrip) // test "TypicalLEDStrip" against "UncorrectedColor" and "TypicalPixelString" to see what you like better
//    .setDither(BRIGHTNESS < 255);
//  LEDS.addLeds<LED_TYPE, DATA_PIN2, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP)
//    .setCorrection(TypicalLEDStrip) // test "TypicalLEDStrip" against "UncorrectedColor" and "TypicalPixelString" to see what you like better
//    .setDither(BRIGHTNESS < 255);
//  LEDS.addLeds<LED_TYPE, DATA_PIN3, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP)
//    .setCorrection(TypicalLEDStrip) // test "TypicalLEDStrip" against "UncorrectedColor" and "TypicalPixelString" to see what you like better
//    .setDither(BRIGHTNESS < 255);
//  LEDS.addLeds<LED_TYPE, DATA_PIN4, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP)
//    .setCorrection(TypicalLEDStrip) // test "TypicalLEDStrip" against "UncorrectedColor" and "TypicalPixelString" to see what you like better
//    .setDither(BRIGHTNESS < 255);
//  LEDS.addLeds<LED_TYPE, DATA_PIN5, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP)
//    .setCorrection(TypicalLEDStrip) // test "TypicalLEDStrip" against "UncorrectedColor" and "TypicalPixelString" to see what you like better     
//    .setDither(BRIGHTNESS < 255);
//  LEDS.addLeds<LED_TYPE, DATA_PIN6, COLOR_ORDER>(leds, NUM_LEDS_PER_STRIP)
//    .setCorrection(TypicalLEDStrip) // test "TypicalLEDStrip" against "UncorrectedColor" and "TypicalPixelString" to see what you like better   
//    .setDither(BRIGHTNESS < 255);

  delay(500);
  Serial.begin(115200);
  Serial.setTimeout(500);
  LEDS.clear();
  LEDS.show();
  Serial.println("Ready to receive colors."); 
}

void loop() {
  if(Serial.available() > 0) {
    Serial.readBytes(inputBuffer, numOfBytes);
  }
  for (int j = 0; j < numLeds; j++) {
    leds[j] = CRGB(inputBuffer[(j*3)],inputBuffer[(j*3)+1],inputBuffer[(j*3)+2]);
  }
  LEDS.show();
}
 

Attachments

  • Screenshot 2025-04-30 at 11.57.14 AM.png
    Screenshot 2025-04-30 at 11.57.14 AM.png
    752.5 KB · Views: 14
  • Screenshot 2025-04-30 at 11.58.22 AM.png
    Screenshot 2025-04-30 at 11.58.22 AM.png
    849.7 KB · Views: 16
  • Screenshot 2025-04-30 at 124718 PM.jpeg
    Screenshot 2025-04-30 at 124718 PM.jpeg
    253.1 KB · Views: 14
  • Screenshot 2025-04-30 at 124728 PM.jpeg
    Screenshot 2025-04-30 at 124728 PM.jpeg
    182.1 KB · Views: 14
Back
Top