-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicated Neopixel 'show' #1027
Comments
Thanks @DaveAtKitronik. I've asked the team for input as I don't know the full context for this addition and will follow up as I find out more. It's not new in the V3 Python Editor. It was added in MicroPython for micro:bit V2. We think it might have been added to align with other MicroPython ports (example), but I'm not sure of this yet. What we have in the Python Editor API tab and autocomplete was derived from this documentation which covers both show and write but doesn't give any context. MicroPython for micro:bit V2 can be found in its own repo. Checking there confirms that the functions are the same. I'll follow up when I know more. I doubt we can remove it at this point due to backwards compatibility. One thing that would help, that we hope to do in future, is to add Reference tab documentation for Neopixels (in addition to the terser API documentation). That could then prioritise the approach that works on V1 and V2 micro:bits. |
The 'same' functionality isn't the issue - although duplication is not great. I hadn't seen it before yesterday, but that's probably because I don't expect APIs to change, and we have to make as much as possible work on V1 and V2, so wouldn't be looking for V2 only API changes. |
We've just confirmed with Damien that, indeed, the V2 |
The neopixel api has show() and write() functions:
They appear to do the same thing, but one is for V2 only. This seems unnecessary duplication, with the potential to cause a slightly mystifying failure if a user only has a V1 micro:bit:
The autocomplete lists all the things:
I haven't managed to find any 'code' implementing the new write function in the micropython repo (https://github.com/bbcmicrobit/micropython) so can't see why there is a V2 version.
Would suggest removing the duplicate write(), and leaving the show() as this has been the API forever.
The text was updated successfully, but these errors were encountered: