This module is a concrete driver that will push the led data through an SPI port. It is mainly intended for WS2812 led strip,
The protocol used is the one as expected by an WS2812 chip. By adjusting the settings you can also use it for other led chips. See the hardware documentation for more information on to wire it up.
Changed defaults
:speed_hz: The bus speed is set to 2.6MHz (2_600_000) by default.:delay_us: The default is set to 300us (which works for all supported led strips)
Options
This driver accepts the options specied by Fledex.Driver.Impl.Spi, but you can in addition
specify:
:led_type(default::grb): This way you should be able to use it also for a WS2811 led strip by specifying:rgb, and for WS2813, WS2814, and WS2815 led strips by specifying:grbw. You can also drive a WS2805 by specifying:rgbw1w2. You can specify the white colors by using an colorint (0xw2w2w1w1rrggbb) or anFledex.Color.RGBWstructure.
Notes
- The
:delay_ustiming of the WS2812 is not consistent the same spec mentions>=50usas well as>300us. So you might have to experiment a bit. We use here the higher value because it aligns with the other supported led strips. But it has been tested with the lower value too and it seems to work. - The white LED can be used by using the extended version of the
Fledex.Color.Types.colorint/0. - This driver has only been tested with a WS2812. All others are only based on the specs.