Mu Editor Instruction Manual

Created October 1st, 2019

Revision History

Date Revised

Revised Contents

2019/10/1

First release2019/11/20

Plotter information added

2020/04/23

Administration screen information added

Index1.

Getting Started ......................................................................................................... 1

2.

GUI .......................................................................................................................... 1

3.

The Administration Screen ...................................................................................... 9

1. Getting Started
You can use Mu Editor to write Python scripts (programs) you can transfer to your ArtecRobo Core Unit.
This manual explains how to use Mu Editor.

2. GUIModeUse the Mode button to open the Select Mode window. Select Studuino:bit.

New
Use the New button to create a new script in the editor.

After you click New the editor will display
your new script.
Click on the script tabs to switch between
scripts you’re currently working on.

1



Load
Use the Load button to open any Python scripts you’ve saved.

The default display folder will be
mu_code, in the Users folder.

Save
Use the Save button to save any Python scripts you’ve edited using Mu Editor.

Save your Python script.
The default save location will be
Mu_code, in the Users folder.

2RunUse the Run button to run the Python scripts you’ve edited using Mu Editor on yourArtecRobo Core Unit.

This window will open at thebottom of the screen.
The line >>> will appear, and theCore Unit will run the program
you’ve written in Mu.

When you click Run, a window will open at the bottom of the screen that lets you use REPL. As
long as REPL is open, the Transfer and Files buttons will be grayed out and unavailable. To
close the REPL window and make Transfer and Files usable, click the REPL button.

3Transfer
The Core Unit comes with ten sample programs installed on it. If you start up the Core Unit while holding
down the A Button, you’ll enter Program Select Mode, where you can pick one of the sample programs(numbered 0-9) to run. For more information on the sample programs and how to run them, see sections
3. Starting the Core Unit and 4. Running the Sample Programs in the manual linked below.
https://www.artec-kk.co.jp/artecrobo2/pdf/en/82552_man_K0419_E.pdf
You can transfer Python scripts you write in Mu Editor to the same slots on the Core Unit where thesample programs are saved. Click the Transfer button, and the transfer slot selection window willappear.

Click Transfer to open this window,
where you can choose one of 10
transfer slots (0-9). Click the Transfer
button next to the slot you want to saveyour program in to make the transfer.

When the transfer is done,
the message Finished transfer
will appear in the status bar.
You can run your transferred program using the Core Unit’s Program Select Mode.

4Files
Use the Files button to view the files on your Core Unit and your PC while you’re editing.
This window will open at the bottomof the screen. The Files on yourdevice on the left are the files on yourCore Unit. The Files on yourcomputer on the right are the files in
the mu_code folder on your PC.

When you click Files, a window will open at the bottom of the screen. As long as this window
is open, the Run, Transfer, REPL and Plotter buttons will be grayed out and unavailable. To
close this window and make these other buttons usable, click the Files button.
Drag and drop files between the Files on your device and Files on your computer windows to move files
between your Core Unit and PC.

Right clicking a file from the Files on your device window lets you delete it. Right clicking a file from theFiles on your computer window lets you open it in Mu Editor. To delete files from the Files on yourcomputer window, access them directly using your PC’s file explorer instead.

5



REPL
Use the REPL button to open a REPL window.

The REPL console will appear here.

When you click REPL, a window will open at the bottom of the screen that lets you use REPL.
As long as REPL is open, the Transfer and Files buttons will be grayed out and unavailable. To
close the REPL window and make Transfer and Files usable, click the REPL button.
You can use the REPL console to run each line of your script one-by-one. Type in the program from theexample on page 1 after the >>> as shown below, and you’ll get an identical result (the word “Hello” willappear on the LED display).

6

PlotterThis button opens a graphing screen.

Your data can be graphed here.

When the graphing screen is open, the Transfer and Files buttons will be grayed out andunavailable. Clicking Plotter again to close the graphing screen window will make Transfer andFiles usable.
The plotter can create graphs of data it receives in a tuple format.
For example, the program shown below picks a random number from 1 to 10 once every secondand gives its results as a tuple.

Write this program in the editor, then connect your PC to the Core Unit via USB and press the Runbutton. Once the program is running, press Plotter to see the random numbers the program
generates each second graphed on the screen.

7

Zoom-in, Zoom-out, ThemeUse these buttons to change the size of the text or the appearance of the editor.

CheckUse the Check button to run a syntax check.

The editor will check your program’s syntax.

8TidyUse the Tidy button to change your program code into Python syntax.

The code will be formatted
like Python code.

3. The Administration Screen
You can use the administration screen to change the settings for the Mu editor and your Core Unit. Click theMu Administration button at the bottom right of the window to open the Mu Administration screen. We’ll
explain the Studuino:bit-specific features (Firmware flasher and MicroPython Third Party Packages) in thismanual. Check out https://codewith.mu/en/howto/1.0/read_logs to learn about the Current Log tab,and https://codewith.mu/en/howto/1.0/python3_envars to learn about the Python3 Environment tab.

9Firmware Flasher

This feature allows you to update MicroPython. The screen this tab displays will be different depending on
your Mu editor’s settings. If the screen shown below on the left appears, follow the How to flash
MicroPython to your device instructions it shows to update MicroPython. If the screen show below on theright appears, follow the instructions below to change the Mu editor’s settings.

The Firmware flasher requires the esptool module. Follow these steps to add the esptool module to the Mueditor.
① Go to the Third Party Packages tab.
② Add esptool.
③ Click OK.

The window will close automatically after you change this setting.
10

MicroPython Third Party Packages

This feature lets you install the MicroPython package provided by PyPI* on your Core Unit. Consult theon-screen How to install MicroPython library to your device instructions.

This installation uses a network connection, so it make take some time. After installation, the following dialog
window will appear on screen. If the installation was successful, the message will include an OK.

*PyPI (the Python Package Index) is a repository used to store packages made in Python. Visit the URL
below to view the packages registered there.
https://pypi.org/
Using this feature in the editor lets you update the libraries that control ArtecRobo2.0 and IoT functions,which can be found on PyPI.
https://pypi.org/project/micropython-artecrobo2.0/
https://pypi.org/project/micropython-studuinobit-iot/11

Third Party Packages

This feature lets you install or uninstall the MicroPython package provided by PyPl in the Mu editor.
Write the name of the package you want install in the editable box (outlined in red below). To uninstall apackage, delete its name from the editable area.
When you click the OK button, the package will be installed or uninstalled.

Mu Editor Instruction Manual

84026

K0620

12