
CODE YOUR APPLICATION
We will build an application in MakeCode to pass
serial data back and forth from the micro:bit and
the computer through a USB cable.
We’ll need to add a few lines of specialized
code, as shown in Figure
I
.
• Start a new project and explore the Serial
category (aka Serial drawer) off to the side.
• Place the large square serial redirect
to block into the on start block in your
workspace to initialize communication.
• Set the TX and RX dropdown menus to USB_TX
and USB_RX respectively, and leave the baud
rate as high as it will go, 115200 (this allows
lightning fast data transfer).
We’ll need a way for the micro:bit to