Flash Scripts with Python Editor

What is a Script?

A script, also called a program,  is a set of instructions that a computer runs to make the computer perform tasks.  Scripts make phone apps do their jobs, and they also make web pages respond to your clicks and taps.  Scripts for the micro:bit can make it do all kinds of interesting apps as you will see.  

For the micro:bit to run a script, it first needs to be transferred to the micro:bit module’s flash memory. 

In this activity, you will use the micro:bit Python Editor V3 to write scripts and to transfer scripts into the micro:bit module’s flash memory.

The micro:Bit Python Editor v3 runs in your Chrome or Microsoft Edge browser. If you must be offline while writing and loading scripts for your micro:bit, you may use the optional Mu editor installed on your Windows or Mac computer

 

Using the Python Editor v3

The instructions below guide you step-by-step through connecting your micro:bit to your computer and running your first script. The video and red checklist instructions are about the same.

Make sure to follow along and repeat the steps with your own micro:bit.

  • Run Google Chrome (recommended) or Microsoft Edge.  
  • Go to https://python.microbit.org/v/3.
  • If the site asks about cookies, it doesn’t gather personal information, so there’s no “wrong answer.” 
  • If it shows a Welcome… popup, click the Start coding button.  
  • (Feel free to watch that video after you’re done with this page, it’s at https://youtu.be/mREwMW69qKc.)   
  • Click the right (simulator) panel’s play button, and observe what the script will make the micro:bit do.  
  • Click the Send to micro:bit button.  

 

  • When the ‘Connect cable’ popup appears, connect the micro:bit to your computer with the USB cable (using your USB A to C Adapter if you need it).  Then, click Next.

 

  • When the Select micro:bit popup appears, make a note of what it’s telling you to do in the next popup, namely: choose your micro:bit and then select Connect.  Click Next.
  • In the ‘python.microbit.org wants to connect’ popup: choose your micro:bit and click Connect.

 

  • Check for the micro:bit flashed message; it’s just above the Send to micro:bit button.

 

  • Check the micro:bit module's LED matrix display to make sure what it displays matches what you saw in the simulation.