This tutorial for Python editor v2 has been replaced by Get Started with micro:bit and Python [1], for Python editor v3.
The micro:bit module is a tiny computer with lights, buttons, and sensors. Follow this tutorial to get ready for programming your micro:bit on its own, or as the brain of the cyber:bot robot.
There are two micro:bit software options for programming the micro:bit on the cyber:bot:
(1) Not compatible with Win RT or Win 10 S-mode
(2) Win 7 does not support web-based serial debugging
(3) Win 7 requires extra driver install; Win 8/10 support automatic
(4) Requires Google Chrome browser 6.5 & up
Need help deciding what is best for your classroom? Email education@parallax.com or all our Educator Hotline 916-701-8625.
If you choose the Online Python Editor, there's nothing to install!
That's it! You are ready to go on to the next page, Test your Connection [5].
Online Python Editor Versions
These Parallax tutorials were originally created with the Online Python Editor versions 1 and 2. Software screencaptures and other illustrations, as well as Python Editor links, may go to v2 ( https://python.microbit.org/v/2 [3].) until all the tutorials can be updated to the Editor v3. All these tutorials are compatible with the updated Python Editor v3; just be aware that the screencaptures may not match yet.
If you are using Windows 7, you will also need to install the mbed serial driver to activate the serial debugging feature. You will need to be logged in to your computer with administrator rights to do this.
Download mbed serial driver [6]
That's it! You are ready to go on to the next page, Test your Connection [5].
When connected, the micro:bit should appear to your computer as a removable drive, like a USB thumb drive, where you can view and drag-and-drop files.
If this is the first time your micro:bit has been used it may display some symbols and messages on its LED matrix - play along if you like!
A preinstalled program inside your micro:bit called firmware enables it to communicate with a computer and execute the scripts you write and flash. Your micro:bit needs to be running a certain version of firmware to be compatible with these cyber:bot and cybersecurity tutorials.
This page will guide you through checking your micro:bit module’s firmware version, and updating it if needed. Updating, if needed, takes only a few extra steps, and you will only need to do it once.
For more info, visit the identifying the BBC micro:bit version page [7].
Keep in mind, you only need to continue here if your micro:bit hardware is V1.
The steps in that section will guide you through:
Now, you are ready to write your first program for your micro:bit module. Follow the same procedure for all the programs you write with your chosen micro:bit software.
from microbit import * display.scroll("Hello")
You have two choices for transmitting your program to the micro:bit module:
— OR—
No compatible device found?
If you see a message saying "No compatible device found" you can use the Download button as noted above. If you are on Windows, you can follow the directions here [9]for a possible fix.
from microbit import * display.scroll("Hello")
You have two choices for transmitting your program to the micro:bit module:
— OR—
Your computer will transmit the program to your micro:bit. Watch the LED matrix display!
A program made up of one or more instructions for a processor to execute. Here, the instruction display.scroll("Hello") made the letters H e L L o scroll across the micro:bit module's LED matrix one at a time.
In the Python language, you can use specialized instructions just for the micro:bit that are grouped into modules. For one of these instructions to be used, its module must be named and imported as part of the program. The display.scroll instruction is part of the microbit module. So, the program begins with from microbit import * to make that instruction available. Click the link below to see all of the instructions in the microbit module group.
Links
[1] https://learn.parallax.com/tutorials/robot/cyberbot/get-started-microbit-and-python
[2] https://www.parallax.com/product-category/microbit/mb-modules/
[3] https://python.microbit.org/v/2
[4] https://github.com/mu-editor/mu/releases
[5] https://learn.parallax.com/node/1895
[6] http://os.mbed.com/media/downloads/drivers/mbedWinSerial_16466.exe
[7] https://support.microbit.org/support/solutions/articles/19000119162-how-to-identify-the-version-number-of-your-micro-bit-
[8] https://microbit.org/guide/firmware/
[9] https://support.microbit.org/support/solutions/articles/19000089574-beta-testing-mbed-driver-doesn-t-work-with-windows
[10] https://microbit-micropython.readthedocs.io/en/latest/microbit.html