MicroPython in BBC Micro:bit : Why Mu is better than the Online Python Editor?
What is Mu?
Mu is an open source Python editor for beginners, designed to make the learning more pleasant. It lets learners experience success in coding early on, which is essential when you are learning something new. Most programming tools are written by developers for developers. Mu, however, was written by a teacher for students.
Mu is the brainchild of Nicholas Tollervey who is a musician who became interested in Python. He wanted a simple interface without the complexity of editors like IDLE3. So, he created the Mu editor with support for standard Python 3, BBC Micro:bit, CircuitPython and Pygame Zero. You can install Mu in Windows, Mac OS, Linux and even on a Raspberry Pi.
Features in Mu:
Mu’s micro:bit mode has all the features you cannot get from using the browser-based editor. These are accessed via these four buttons:
- The “Flash” button automatically puts your Python code onto the connected micro:bit. In the Online Python Editor, you have to manually download and then flash the program on to the Micro:bit.
- Mu’s “Files” button makes it easy to access, put, get and delete files on your device. The button opens two panes. The pane on the left lists all the files inside the file system of the Micro:bit. The pane on the right lists all the files in your mu_code directory on your computer. The only way to access the file system, in the online python editor is using the file system and os commands.
- The term “REPL” stands for “Read, Evaluate, Print, Loop”, which does a line by line execution of instructions. Using Mu’s REPL is like having a conversation with the Micro:bit in MicroPython. It’s very useful for a beginner to try out different methods. It’s also helpful in debugging codes. The online python editor does not have this amazing feature.
- Finally, the “Plotter” button opens Mu’s plotter. If your Micro:bit is outputting numbers via the serial connection, the plotter will display them as a graph. This is incredibly useful for visualizing any data you might be measuring via the Micro:bit
Thus, due to features like Automated Flashing, Access to the File System, the REPL and the plotter, Mu is better than the online MicroPython editor.