Skip to main content

27 September 2022

Introducing the Micro:bit simulator for python online

Pete Dring profile image
Written by

Pete Dring | Secondary School Teacher (11-18)

Since its launch in 2014, the BBC micro:bit  has helped inspire an estimated 25 million young people in over 60 countries across the globe by introducing them to the endless creative possibilities that can be explored via physical computing.

For anyone who’s not familiar with the pocket-sized computer, its low cost design of an embedded ARM processor with a push button either side of a simple 5x5 LED screen along with all sorts of built in sensors make it perfect for students who want to design and create inventions that can change the world around them to make it a better place.

Writing code to control a micro:bit can be done with either block based programming using the Microsoft makecode online editor or text based programming. The micro:bit python web editor has just been re-developed to make text based programming as simple as possible.

Many teachers in the CAS community have been involved in trying out the new features which include:

  • Drag and drop code examples
  • Code structure and error highlighting
  • Auto-complete
  • Quick ideas to get started
  • Simulator

The addition of a simulator is an absolute game changer. There still nothing quite like the sense of wonder and satisfaction of running your code on an actual physical device and seeing things light up, move or interact with the real world. However, being able to test your code on a simulator has three main advantages:

  • Reduced cost: Every student in the class can simulate their code on their chromebook, laptop or PC even if they don’t have access to a physical micro:bit. When it’s working in the simulator, the teacher can demonstrate the code on a one micro:bits or share out a small number of devices with the class.
  • Reduced setup time: Using a simulator means that students can start trying out their code before the teacher has handed out physical devices and can continue developing even after micro:bits have been collected in. This saves time (and stress!) at the start and end of physical computing lessons
  • Reduced development time: It’s very satisfying when your code runs correctly on a physical device, but it’s very frustrating when it doesn’t. Watching an error message scroll slowly across a 5x5 LED screen is much slower than seeing an error on your screen. Debugging using a simulator can dramatically increase productivity and take some frustration out of the development experience.

A micro:bit simulator has been around for block based programming and the javascript text based programming environment in MakeCode but – until now – a micro:bit python simulator has only been available on third party tools.

There’s a fascinating blog which details some of the challenges and approaches involved in the implementation of the python micro:bit simulator. You can try it out for yourself online here: https://python.microbit.org/

At the time of writing, the new features are in beta but it looks like they’re almost ready to be moved to the main editor site online.

Have you tried the new micro:bit python editor out with students? Which feature do you like the most? Will the simulator be as much of a game changer for your students as it has been for mine? Are there any new features you’d like to see implemented? It’d be great to hear your thoughts via the physical computing CAS Community discussions here.

Discussion

Please login to post a comment