BBC micro:bit: The missing python simulator

last edited Jun 15 2016 by Pete Dring | Created by Pete Dring | Other contributors:

Python projects your students can do with or without a microbit


If your KS3/KS4 students learn to program in python then coding the micro:bit in python makes sense - it’s a great way for students to explore and understand the key concepts of computational thinking when they can ‘see’ their code at work.

Unfortunately, whilst you can write python code for the micro:bit either online or via the excellent mu editor, you can’t simulate that code in a browser like you can for the other programming languages on the BBC website.

Simulating code is no way near as fun as seeing it work on an actual device. But it is important. This resource is my attempt to create a working micro:bit simulator for create.withcode.uk so that you can test your micro:bit python projects in your browser: with or without an actual BBC micro:bit.

This isn’t designed as a replacement for programming the physical devices - but it’s hopefully going to be useful for situations where students have lost / broken / sold their micro:bits or where you want to share / debug code with students quickly.

You can use the simulator by going to create.withcode.uk, typing in:

from microbit import *

or

import microbit

Run the code with Ctrl + Enter or using the button in the bottom left.

Debug the code line by line by pressing Ctrl + .

You can also change the options to animate line by line at a speed you set, so you can talk students through what’s happening.

Disclaimer:

This is an unofficial micro:bit simulator. It’s not affiliated with the BBC and it’s bound to have some teething problems. If you find a bug, please let me know via the comments below.

The basics

Each of these tutorials have:

  1. Try it Some working code you can test in the simulator or on a micro:bit to use as a reference or starting point.

  2. Debug it Some broken code so that you can practice finding and fixing common errors

  3. Extend it Some links to find out more and some ideas to stretch the more interested or able.

You can download student activity traccking sheets to get students to record and reflect on their work, with space to keep track of what support they’ve given / reveived to promote independent learning. If your students have 1:1 tablets these pdfs can be shared via Showbie (or similar) so that students can annotate them & you can keep track of their progress. Alternatively, you can print them and get students to fill them in by hand.

Student project ideas and resources

If you use this simulator with your students and find it useful, it’d be great if you could add a link to the resources you use here:

More details

You can find additional projects, ideas, resources and info here

Disclaimers:


By downloading this resource you agree to the CAS resource guidelines and use it appropriately.

Note: Unless otherwise specified, this resource and all associated files are published here under the Creative Commons Attribution-Share Alike 3.0 Licence. If you wish to use a different license, please state this in the description.

Read our resource guidelines

Feedback and Comments


Available when logged in (sign-up, for free):
  • View 5 comments on this resource.
  • View resource history, links to related resources.
  • Leave feedback for the author(s), or help by editing the resource.
Try_debug_extend

This resource has attached files: to access these files, please tick the box below to assent to the license terms

License: The resources on CAS website are under Creative Commons Attribution-Share Alike 3.0 licence unless otherwise specified by the resource creators.

You must confirm that you have read and agree the licence's ToS before you can download the attachments of this resource.

It has been downloaded 318 times.

I have read the licence agreement of this resource and agree to abide by its terms and conditions.
Categories: