Example Code for micro:bit-Mind+
Last revision 2025/12/19
Write a program using Mind (example code shown below), burn it to the Micro:bit, and observe the serial port output results.
Hardware Preparation
- 1 x micro:bit
- 1 x IO Expansion board
- 1 x Thin-film pressure sensor
- 1 x Digital cable
Software Preparation
Wiring Diagram
Connect the sensor to the P1 pin on the expansion board.

Sample Code

Result
| When no pressure is detected | ![]() |
![]() |
|---|---|---|
| When pressure is detected | ![]() |
![]() |
Additional Information
Note: The greater the force, the higher the detected value will be.
Was this article helpful?




