Library providing functions to work with Cutebot kit for BBC micro:bit board in Python language.
See python docstrings in cutebot.py for description of available functions.
There are several methods how to flash your Python program to micro:bit board.
Some of these methods are described below. All of them has been tested recently.
After these steps you will be able to import the cutebot library like any other python module.
import cutebot
# or
from cutebot import *There is always possibility to simply copy content of the cutebot.py above your Python code without importing the module.
It will work, however this way is not recommended.
Micro:bit is designed to help people learn to program so do not learn bad practices.
No additional tools are required. Just a web browser of your choice.
- Connect you micro:bit board to you PC using USB cable
- Click the
Load/Savebutton - Add
cutebot.pyto project files - Write your code in editor
- Click the
Connectbutton, then click theFlashbutton (in Chromium based browsers) OR download the hex file and copy it to your micro:bit.
Simple Python editor. This method looks similar to the previous one but this editor is available offline.
Prerequisites:
- Connect you micro:bit board to you PC using USB cable
- Start Mu editor in micro:bit mode
- Copy
cutebot.pytomu_codefolder in your home directory (after that it will be listed inFiles) - Click the
Filesbutton - Drag and drop
cutebot.pyin the left box - Write your code in editor
- Click the
Flashbutton
Prerequisites:
These are the same command line tools the Mu editor uses in background.
- Connect you micro:bit board to you PC using USB cable
- Flash MicroPython interpreter to you board using
uflashcommand - Upload cutebot.py to you micro:bit using microfs
ufs put cutebot.py - Upload you program (the name
main.pyis required)ufs put main.py
Please note that every use of uflash or copying a new hex file will clear the board's storage
so your .py files copied with ufs will be deleted.
- micro:bit MicroPython documentation
examples/folder for python implementation of official examples (not all of them are ready yet).- My micro:bit bakefile repo
- Difference between uploading a hex file with program and a
main.pyusing microfs