1. Introduction

1.1. PC-Microbit

These docs will help you code your microbit using micropython.
Micropython is a version of python for running on small devices like the microbit.
../_images/microbit_happy.png

1.2. Home pages:


1.3. Online microbit coding:

Online microbit coding: https://python.microbit.org/v/3.

1.4. Key microbit references:


1.5. Microbit software using micropython:

Comparison of microbit programming options:
The standard online micropython editor: https://python.microbit.org/v/3 is consistently the most up to date online editor for the microbit, supporting V2 of the micorbit.
Choose Send CTRL-C to REPL in the serial tab 3 dots button to see the MicroPython version; v1.18.
The Mu editor for laptops, https://codewith.mu/en/tutorials/1.2/microbit, is a simple choice for desktop coding on the microbit.
As of Dec 2023, Mu v1.2 doesn’t support some of the newer features of the microbit V2.
Use REPL to see the MicroPython version; v1.18.
Thonny for laptops, can be downloaded from https://thonny.org/.
Thonny v4.14 uses MicroPython v1.18 on 2023-10-30; micro:bit v2.1.2 with nRF52833
Edublocks, https://app.edublocks.org/#MicroBit, is an online editor with both blocky code and micropython, and can display the block code and micropython code side by side and a simulator.
Add a block to import the microbit library then check the serial tab to see the MicroPython version; v1.18.
The blocks may not cover the full range of possibilities available elsewhere.

1.6. Micropython simulator:

https://python.microbit.org/v/3 uses the latest micropython for the latest version of the microbit.
An older simulator is at Create with code UK, https://create.withcode.uk/. It works with standard python or micropython. Starting the code with “from microbit import /*” will pop up the simulator when the code is run.

1.7. Blocky code simulator:

Edublocks, https://app.edublocks.org/#MicroBit, is an online editor with both blocky code and micropython, and can display the block code and micropython code side by side and a simulator.
Add a block to import the microbit library then check the serial tab to see the MicroPython version; v1.18.

The Makecode website https://makecode.microbit.org/ allows blocky code use, but it has its own unique version of micropython based on its own translation of the typescript code that it uses, and so it will not work the standard online micropython editor. It has a simulator and vast extensions library for exploring other devices that can be connected to the microbit.


1.8. Out of Box hex file v2

The hex file that is on new microbits can be found at: https://microbit.org/get-started/user-guide/out-of-box-experience/


1.9. Firmware

See: https://microbit.org/get-started/user-guide/firmware/


1.10. Sleep, Power off, wake

See: https://support.microbit.org/support/solutions/articles/19000120358-how-do-i-power-off-or-put-the-micro-bit-to-sleep-


1.11. Useful sites:


For beginners, using blocky code, these sites may be useful:


1.12. Python references:

For an introduction to python see:


1.13. Micropython differences with Python


Tip

If you are using a trackpad, navigate to various sections and pages by clicking on the same heading in the left sidebar twice, then use the arrow keys to move up and down.