MakeCode
For users who enjoy block-coding, MakeCode allows micro:bit users to utilize hundreds of DUELink modules. While MakeCode supports many boards, we will focus on micro:bit.
Connections
To connect micro:bit to one of the many DUElink modules, you can use the LinkBit module. It extends the micro:bit edge connector and adds a Downlink connector.
Alternately you can also use any of the boards that include an on-board JST connector like the Sparkfun Qwiic micro:bit Breakout
This board includes two JST sockets. One of them becomes a Downlink bringing you hundreds of DUELink module options, that connect in a Daisylink.
Most of these boards don't have the required pull-up resistors on the I2C bus. This might not be a problem in most cases, but we have a PullUp module to solve this if there's an issue. When using our LinkBit accessory a PullUp module isn't needed.
Blinky
Create a MakeCode project like you always did on makecode.microbit.org.
This example blinks the status LED 50 times on any Downlink module
function SendCommand(str: string) {
pins.i2cWriteBuffer(0x1a, Buffer.fromUTF8(str), false);
}
SendCommand("statled(200,200,50)");
In blocks, the code above looks like this:
The LED will blink 50 times then stops!
Extension
A DUELink extension is planned for the future. Consider the other supported alternatives below.
Alternatives
Another great block-coding option is MicroBlocks. It is fully supported, allowing micro:bit to connect to DULink modules.
Arduino is another great option if your board supports it.