FastLED NeoPixel v1.0.3
Loading...
Searching...
No Matches
FastLED_NeoPixel.h File Reference

Header for the FastLED_NeoPixel library. More...

#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
#include <FastLED.h>

Go to the source code of this file.

Classes

class  FastLED_NeoPixel_Variant
 FastLED implementation of the Adafruit_NeoPixel class. Base class for all strips. More...
 
class  FastLED_NeoPixel< NumLeds, DataPin, RgbOrder >
 FastLED implementation of the Adafruit_NeoPixel class for WS2812B strips, with data. More...
 

Functions

constexpr EOrder NeoToEOrder (uint32_t neoOrder)
 

Detailed Description

Header for the FastLED_NeoPixel library.

Function Documentation

◆ NeoToEOrder()

constexpr EOrder NeoToEOrder ( uint32_t  neoOrder)
inlineconstexpr

constexpr function that converts an Adafruit_NeoPixel color order preprocessor define into a FastLED color order enum (EOrder) for use with the FastLED library.

For C++11 compatibility this uses chained ternaries instead of a more elegant switch statement.

This accounts for all RGB Adafruit_NeoPixel color orders, including both 800 KHz and 400 KHz speeds. It also handles FastLED color orders (EOrder).

Although the speed values are evaluated because they modify the underlying number, passing a speed value to this function has no effect on the output speed of the FastLED library. This function purely handles color order.

FastLED colors enumeration values (EOrder) are evaluated first, then high speed (default) NeoPixel color orders, then finally low speed NeoPixel color orders. If no match is found then 'GRB' color order is returned. This is the default color order used by most NeoPixel (WS2812B) strips.

RGBW color order is purposefully not evaluated. The FastLED library does not support RGBW and any attempts to use an RGBW strip with it are going to end badly ([PartsNotIncluded.com hackery aside] (https://www.partsnotincluded.com/fastled-rgbw-neopixels-sk6812/)). If they are passed to the function, RGBW color order defines will use the default GRB order.

This function is auto-generated from a Python script. See the neo_order_generator.py script in the extras folder.