-
-
Notifications
You must be signed in to change notification settings - Fork 257
DotStar Methods
There is a large selection of DotStar (two wire) Methods to pick from. They generally should only be used with DotStar Features. The names of them come in several varieties: The bit bang, hardware SPI, hardware SPI with a specific speed, and the platform specific named.
"<insert LED name>Method"
Simply insert the model name of your LED before "Method" and more than likely you will find a method that works for you.
- DotStarMethod - (generic DotStar, APA 102) The most compatible and if yours isn't listed below a good first selection.
- Ws2801Method - (WS2801)
- Tlc5947Method - (TLC5947)
- P9813Method - (P9813) Must use the P9813BgrFeature.
- Lpd8806Method - (LPD8806) Must use either Lpd8806BrgFeature or Lpd8806GrbFeature color feature.
- Lpd6803Method - (LPD6803) Must use one of the many Lpd6803*Feature.
- Sm16716Method - (SM16716) Use the DotStarRgbFeature color feature. Only supported as BitBang.
- Mbi6033Method - (MBI6033) Must use 16 bit per color element color feature like NeoGrb48Feature. Only supported as BitBang. NOTE that due to the unique protocol, the first pixel is at the other end of the strip from where the signal wire attaches. This is unique to these MBI6033.
Provide the Pins to use for Data and Clock by setting them in the constructor:
NeoPixelBus(uint16_t countPixels, uint8_t pinClock, uint8_t pinData)
.
"<insert LED name>SpiMethod"
Simply insert the model name of your LED before "SpiMethod". It will use the available hardware SPI support for the board you build with.
- DotStarSpiMethod - (generic DotStar, APA 102) The most compatible and if yours isn't listed below a good first selection.
- Ws2801SpiMethod - (WS2801)
- Tlc5947SpiMethod - (TLC5947)
- P9813SpiMethod - (P9813) Must use the P9813BgrFeature.
- Lpd8806SpiMethod - (LPD8806) Must use either Lpd8806BrgFeature or Lpd8806GrbFeature color feature.
- Lpd6803SpiMethod - (LPD6803) Must use one of the many Lpd6803*Feature.
Generally, the clock and data pins are not changeable for hardware support and thus the Pins argument is omitted on the constructor. If the pins are changeable like on the ESP32, then provide the pins to strip.Begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss)
.
NOTE: The hardware pins on the board are often labeled as MOSI for data, and MSCLK or CLK for the clock.
NOTE: The SPI clock speed will be 10MHz.
"<insert LED name>Spi<speed>Method"
Simply insert the model name of your LED before "Spi", add a speed designator, and then append with "Method". It will use the available hardware SPI support for the board you build with.
The optional speed designator can be any of the following:
- 40Mhz - very high speed, not all LEDs support this.
- 20Mhz - high speed, most LEDs support this but requires extra care be taken with the wires for good signal without noise.
- 30Mhz - only used with TLC5947. the default for standalone LEDs.
- 10Mhz - the default speed
- 15Mhz - only used with TLC5947. the default for cascaded LEDs.
- 5Mhz - slower speed good for more noisy signal wires
- 2Mhz - slow speed good for poor wiring
- 1Mhz - slow speed good for poor wiring
- 500Kh - slow speed good for poor wiring
- Hz - exposes the ability to set the speed at run-time. See
strip.SetMethodSettings()
andNeoSpiSettings
.
A few examples would be:
- DotStarSpi40MhzMethod - generic DotStar running on hardware SPI at 40Mhz.
- Ws2801Spi2MhzMethod - WS2801 running on hardware SPI at 2Mhz.
- Tlc5947Spi15MhzMethod - TLC5947 running at its low normal of 15Mhz.
- P9813SpiHzMethod - P9813 running on hardware SPI with the speed set at run-time by latter calling
strip.SetMethodSettings()
.
Generally, the clock and data pins are not changeable for hardware support and thus the Pins argument is omitted on the constructor. If the pins are changeable like on the ESP32, then provide the pins to strip.Begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss)
.
NOTE: The hardware pins on the board are often labeled as MOSI for data, and MSCLK or CLK for the clock.
"<insert LED name><insert hardware detail><insert option speed>Method"
In most cases the above basic named methods should be all the methods you need to use for all platforms. In a few cases, there are alternative methods that are useful to use on some platforms. Here are just a few examples...
- DotStarEsp32VspiMethod - ESP32 platform, using hardware VSPI to drive output, for the generic DotStar.
- DotStarEsp32Hspi2MhzMethod - ESP32 platform, using hardware HSPI to drive output, at 2Mhz speed, for the generic DotStar.
- DotStarEsp32DmaSpiMethod - ESP32 platform, using hardware DMA SPI to asynchronously drive output, for the generic DotStar.
Currently supported platforms that have specific methods: