microsoft / microsoft/pxt-microbit

NeoPixe and BLE extensions compatibility

Open
#6,898 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

extension
Dominant language
TypeScript
Stars
804
Forks
721
Avg merge
2d 9h
Merged PRs (30d)
2

Description

Currently the NeoPixel MakeCode extension is incompatible with Bluetooth.
This is due to the current implementation for V1 and V2 using assembly, which does not work well with the BLE SoftDevice interrupts.

Image

For micro:bit V2, CODAL has created a PWM-based Neopixel driver which is BLE compatible.

The extension can be updated to use this alternative driver for V1, but is there a way for an extension to be marked as BLE compatible with V2 and BLE incompatible with V1?

One possibility would be to have a V2-specific neopixel extension, but that can be confusing and harder to find.
Another option could be to update the extension to throw an error in V1 if BLE is enabled when the extension is about to be executed, but a runtime error in a worst UX for V1, compared to the current incompatible error pop up.

When a project in MakeCode has both extensions added, could a WebUSB connection in MakeCode with micro:bit V1 trigger the same "BLE incomatible" pop up? So that the user has to explicitly select to keep or remove BLE or Neopixel extensions. Even if it only happens in sessions with a WebUSB connection, at least that's a much better V1 user experience than having a runtime error.

Could we also get some stats to help figure out options? If we could know how many users add the BLE extension, and the % of V1 vs V2 users adding this extension, that'd give us an indication how many user these changes could affect.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by tracing how the NeoPixel and BLE extensions declare micro:bit V1/V2 compatibility and how the WebUSB connection presents incompatibility warnings; compare that with the CODAL PWM-based NeoPixel driver. Done means reaching an agreed compatibility design, including any needed V1 behavior and user-facing warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.