Example Code for micro:bit-Read Rotary Knob Analog Value
Last revision 2025/12/31
This guide explains how to connect and read analog values from a rotary knob using micro:bit, providing detailed hardware and software preparation, wiring diagrams, and sample code for MakeCode and Mind+.
Hardware Preparation
Connect a rotary knob to pin C0.
Software Preparation
-
MakeCode User Library Link: click here
-
Mind+ Upload Mode User Library Link: click here
-
Mind+ Python Mode User Library Link: click here
Wiring Diagram

Sample Code
| MakeCode Program ScreenshotProgram Link:click here | Mind+ Program Screenshot |
|---|---|
![]() |
![]() |
Result

Was this article helpful?


