Document how to create blocks and supporting code for new peripherals

Issue #166 resolved
David Talmage created an issue

Please document how one can create blocks for new peripherals.

If you do that, I will make blocks for these BBC micro:bit peripherals:

Comments (3)

  1. John Maloney repo owner

    We’ll try to document that soon. Meanwhile, here’s a sketch…

    The basic process is to create and test a collection of command and reporter blocks to control the peripheral using the buttons in “My Blocks”. Select “show advanced blocks” from the MicroBlocks (gear) menu to enable advanced features, then select “export functions as library” from the file menu. That will create a MicroBlocks library (with extension .ubl) that can be shared with other users and imported into projects that want to use the peripheral.

    I think you can use most of the features of the Zip Halo HD already via the NeoPixel library – with the possible exception of the microphone. If that microphone can be read as an ordinary analog input, then it will be easy to use. If it uses a more complex encoding such as PDM then you may want to wait until we add support for PDM microphones to MicroBlocks. (There are boards that have such microphones built in so we’re planning to add support for them.)

    I’d love to see a WaveShare library! To implement that you’ll need to use the SPI commands from the Comm category that appears when you show advanced blocks.

    Keep us posted on any progress you make!

  2. Log in to comment