A big advantage of this board is its low-power Nordic radio, which allows MicroBlocks to progran the board wirelessly via Bluetooth Low Energy (BLE).
Pins 0..10 are GPIO pins. Pins 0..5 can be analog inputs. This board also has three tiny LEDs: red (pin 11, the user LED), blue (pin 12), and green (pin 13). All LEDs are inverted: set the associated pin LOW to turn the LED on.
The Sense version also includes an onboard PDM microphone, temperature sensor, and 6-axis LSM6DS3TR-C IMU, which are supported by the MicroBlocks "Microphone", "Basic Sensors", and "Motion" libraries.
To enter bootloader mode, rapidly click the reset button twice. (The reset button is teeny-tiny, located to the left of the USB port when the port is facing upward.)
A virtual USB drive named XIAO-SENSE will appear.
Download the firmware file, from the MicroBlocks firmware folder then drag the file onto the virtual USB drive.
The firmware will install and, after a few seconds, the virtual USB drive will disappear. You can ignore any warning that the disk was not ejected properly.
Connect the board to your computer with a data USB cable (not a power-only cable).
Run the MicroBlocks editor in a Chrome or Edge browser. Click the connect (plug icon) button:
Select connect (USB) from the menu:
Note: You can also connect wirelessly by selecting connect (BLE) in the connect menu.
Select your board from the dialog and click the connect button:
A green circle and the board name will appear when the board is connected:
If your Xiao nRF52840 has its own power source, you can also connect to it without a USB cable by selecting "connect (BLE)" in the connect menu.
MicroBlocks is a live coding environment so you can test as you code. Click on blocks and scripts to run them. Drag blocks into the scripting pane and assemble them to create scripts.
Your code is stored in persistent flash memory and can run even when the board is not connected to the MicroBlocks editor. Scripts under a when started block run when the board is powered.
MicroBlocks supports concurrency. Up to ten scripts can run at the same time.
In addition to its many built-in blocks, MicroBlocks has nearly 200 libraries that support additional features and peripherals. Click the Add Library button to add libraries.
This script will blink the red user LED:
This script will cycle through the red, blue, and green LEDs:
The Blocks Reference includes many additional examples.