Closed caternuson closed 4 years ago
More commentary. Another possible approach would be to have something like a type
parameter with several pre-defined types. So could then do something like:
pixels = neopixel.NeoPixel_SPI(board.SPI(), 1, pixel_order=neopixel.RGB. type=neopixel.WS2812B)
This would then programmatically set pre-defined timings under the hood based on type.
I think the four attributes in the first post should be constructor kwargs. They don't need to be properties because they should be the same for the entire lifetime of the object.
I would avoid type
because it's a Python keyword and is also less flexible.
Thanks. Submitted as a separate PR #22.
Closing this in favor of #22
For #19 and as another option to #20
This will allow for "tuning" of the underlying timings for better support of other flavor addressable RGBs. There are four parameters that are involved:
frequency
- The SPI bus frequency, really only two values that matter. Added as an init parameter.reset_time
- The reset time value (TRST). Added as a new property.bit0
- The byte that defines timing for a 0 bit (T0H+T0L). Added as a new property.bit1
-The byte that defines timing for a 1 bit (T1H+T1L). Added as a new property.This example shows tweaking the bit 1 pattern which may work for the case discussed in #19 and #20: