1. Introduction

1.1. PC-Microbit-extension documentation

These docs will help you code your microbit using micropython for bots, games and classes.
../_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:

The standard online micropython editor: https://python.microbit.org/v/3.
This is the most up-to-date editor.
Comparison of microbit programming options:
The Mu editor is for laptops: https://codewith.mu/en/tutorials/1.2/microbit.
Thonny for laptops, can be downloaded from https://thonny.org/.

See: https://core-electronics.com.au/tutorials/how-to-program-a-microbit-using-thonny.html for setting up the microbit to use Thonny.

Edublocks, https://app.edublocks.org/#MicroBit, is an online editor with both blocky code and micropython consistent with Mu editor, and can display the block code and micropython code side by side.

1.6. Troubleshooting large file issues

The bot modules, along with a long micropython file can take up most of the space on the microbit or be too large to transfer to the microbit.
The standard online micropython editor will give warning that there is not enough space for a large file on the microbit.
Mu editor can minify the .py files by removing comments and compacting space before producing the hex files to go on the microbit.
Sometimes large files and libraries may cause issues for Mu editor such that the microbit can’t be used by either of these programs as well as not being fixed using maintenance mode (hold down reset button while connecting via USB).
Thonny can help fix such microbits by re-installing the micropython on the microbit. Afte his Mu editor or the online micropython editor can be used again.
A python minifer can be used to reduce the size of the files for the microbit. See: https://python-minifier.com/. Deselect all options so only the most basic minifer actions are carried out.
VSCode also has extensions to Remove Blank Lines and to Remove Comments. These could be used to reduce the size of some modules or micropyhton files. It is best to keep a backup of the files before doing so, since comments and spacing make the original files more readable and useful for further development.

1.7. 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.8. Firmware

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


1.9. 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.10. Useful sites:


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.