MicroPython and the BBC micro:bit

MicroPython Logo
micro:bit

Contents

MicroPython

MicroPython is a “slim” version of Python V3 specifically designed with a small footprint to efficiently run on memory constrained microcontrollers.

Contrary to the claims of some commentators, MicroPython doesn't implement anywhere near the complete complement of Python functionality. Many of the standard Python modules haven't been implemented for the good reason they would provide little benefit in the 'micro' world.

Additionally, a few of the full language constructs and built-ins are also missing from MicroPython. However the subset that is implemented is useful, fit-for-purpose and mostly all that is required.

MicroPython has been ported to an ever increasing list of microcontroller (and their associated development boards) including the BBC micro:bit, ESP8266, ESP32, Pyboard, Raspberry Pi Pico and various STM boards.

The version of MicroPython that has been ported to the micro:bit is an even smaller subset with not all 'standard' MicroPython features available. Still, the developers have done a great job and the language implementation is very solid.

This series is an attempt to teach the MicroPython language as available for the micro:bit without delving in any depth into microcontroller hardware specifics. All the MicroPython examples in the series are original and have been tested on a micro:bit for correctness using the Mu Editor.

BBC micro:bit

The BBC micro:bit is a development board designed by the BBC for use in computer education in the UK. It has the Nordic nRF52833 microcontroller from the ARM Cortex-M0 family at its heart. Integrated with the nRF52833 are additional hardware components including an LED light display, buttons, sensors and many input/output features.

Children in their preteens are taught programming and coding concepts with the aid of this little device. The teachers often have little or no experience themselves and rely upon 'recipe books' of projects to build. Graphical block 'languages' such as MakeCode and Scratch are predominantly used.

Fred's Cave believes this greatly undervalues the use of the micro:bit as an educational aid. While positioning a line of graphical logic blocks on a screen may demonstrate the raw assemblages of a coding algorithm this approach is too simplistic for promoting software engineering as a serious future career path to a young mind.

Final Notes

This website is devoted to exploring all things MicroPython on the micro:bit and is divided into sections that will continually be added to and kept updated on best effort basis. This first section comprehensively documents the MicroPython language as it is available for the micro:bit.

The next section delves into the microbit module in some detail. It particularly addresses micro:bit hardware features that will be required when interfacing external ICs and modules to the micro:bit.

Navigation across the entire website should be easy for most visitors. Each separate section of the site (MicroPython Language, microbit Module, Interfacing Sensors and so on) is accessible through the menu found at the top right of every page. Within a section there are links to all pages running down the left column of each page.

And finally… this entire website is entirely ad-free with no attached spyware, intrusive analytics or trackers. The site does not use cookies. It's completely hand-coded (Visual Studio Code) with the motivation simply as a learning tool for the author to gain experience with MicroPython and its application to microcontrollers.

<  Previous