Paul's current github version* of OctoWS2811, when used with Teensy 4.x, can use any pin to drive LED strips in parallel and it's all shockingly fast.
Here's an example of how to set that up using 8 pins:
If you would like to use FastLED to get all fancy FastLED features, you can hook it up by creating a custom FastLED "controller" which just sends the bits to OctoWS2811 for display. This is all incredibly fast especially on a Teensy 4.x.
To create the custom controller:
To use this:
Enjoy!
Joel
--
* Note: this version of the library is not available through the arduino or platformio library managers yet. For now get it from GitHub.
Here's an example of how to set that up using 8 pins:
Code:
const int numPins = 8;
byte pinList[numPins] = {33, 34, 35, 36, 37, 38, 39, 40};
const int ledsPerStrip = 300;
CRGB rgbarray[numPins * ledsPerStrip];
// These buffers need to be large enough for all the pixels.
// The total number of pixels is "ledsPerStrip * numPins".
// Each pixel needs 3 bytes, so multiply by 3. An "int" is
// 4 bytes, so divide by 4. The array is created using "int"
// so the compiler will align it to 32 bit memory.
DMAMEM int displayMemory[ledsPerStrip * numPins * 3 / 4];
int drawingMemory[ledsPerStrip * numPins * 3 / 4];
OctoWS2811 octo(ledsPerStrip, displayMemory, drawingMemory, WS2811_RGB | WS2811_800kHz, numPins, pinList);
If you would like to use FastLED to get all fancy FastLED features, you can hook it up by creating a custom FastLED "controller" which just sends the bits to OctoWS2811 for display. This is all incredibly fast especially on a Teensy 4.x.
To create the custom controller:
Code:
#include <OctoWS2811.h>
#include <FastLED.h>
#include <Arduino.h>
#include <Util.h>
template <EOrder RGB_ORDER = RGB,
uint8_t CHIP = WS2811_800kHz>
class CTeensy4Controller : public CPixelLEDController<RGB_ORDER, 8, 0xFF>
{
OctoWS2811 *pocto;
public:
CTeensy4Controller(OctoWS2811 *_pocto)
: pocto(_pocto){};
virtual void init() {}
virtual void showPixels(PixelController<RGB_ORDER, 8, 0xFF> &pixels)
{
uint32_t i = 0;
while (pixels.has(1))
{
uint8_t r = pixels.loadAndScale0();
uint8_t g = pixels.loadAndScale1();
uint8_t b = pixels.loadAndScale2();
pocto->setPixel(i++, r, g, b);
pixels.stepDithering();
pixels.advanceData();
}
pocto->show();
}
};
To use this:
Code:
CTeensy4Controller<RGB, WS2811_800kHz> *pcontroller;
void setup()
{
octo.begin();
pcontroller = new CTeensy4Controller<RGB, WS2811_800kHz>(&octo);
FastLED.setBrightness(255);
FastLED.addLeds(pcontroller, rgbarray, numPins * ledsPerStrip);
}
Enjoy!
Joel
--
* Note: this version of the library is not available through the arduino or platformio library managers yet. For now get it from GitHub.