Closed ntoll closed 7 years ago
@tannewt wanna check this one out or i can?
All of the tuple readback changes look good to me.
I don't want to switch auto_show to False by default though. Its a huge win for beginners who are starting with this version because it clearly reinforces the connection between setting state and seeing state change.
Having this difference between neopixel
libraries isn't a huge deal for those going between them because the behavior is almost identical. It'll be a little slower and maybe a little less perfect but its really hard to tell. Thats ok given the huge win it is.
So, please remove the auto_show changes and we should be good to go.
Fantastic. I'll update the auto_show
default as requested. Hurrah and many thanks for the fast turn-around. It'll save me lots of potential book related work. ;-)
Thanks for fixing this up! I'll release a new bundle this week with it.
This PR does several related things that fix backwards compatibility related problems in as "light touch" manner as possible (i.e. we retain all the awesome improvements you've made). :-) It fixes the issues highlighted in #7.
NeoPixel
object returns colour values as RGB tuples. RGB tuples are what every otherneopixel
module on MicroPython returns. Consistency matters! ;-)__repr__
uses RGB tuples to represent colours.auto_write
toFalse
so, once again, this version of theneopixel
module works, by default, in the same way as all the other MicroPython basedneopixel
modules. Obviously, it's very easy to enable this feature when instantiating the object.README
to reflect these changes.Discussion:
I notice you've implemented the update function as
show
and aliasedwrite
. I like how it's consistent with the micro:bit version of theneopixel
module yet also backwards compatible. I believe this is a good thing (it's a more obvious name for such a function, especially if you're a beginner). This also suggests that you care about consistency and compatibility between implementations. Unfortunately, the awesome changes you've made (slicing, auto_write, yay!) also introduce other inconsistencies between different implementations of the module.Ergo, this PR retains all the good stuff while also making this
neopixel
module consistently consistent with all the otherneopixel
modules. :-)It also means that the code examples in my book are no longer knackered. :-P
As always, comments, constructive criticism and ideas are most welcome!