Once you are connected, using the File Editor is pretty straightforward. Currently you can only edit one file at a time to reduce the design complexity.

Editor Mode

The editor mode is the main mode you will be using the CircuitPython Code Editor in. This will allow you to do most of the operations you need to to edit and write new code. When you first open the editor, it will attempt to load code.py from the root directory of the circuit board. If the file is not found, it will create a new unsaved document for you to edit.

New File

This option will close any files you are currently working on after making sure they are saved and create a brand new file.

Open File

This option will allow you to open an existing file to work on editing. The code editor tries to determine if the file you are trying to open is a text file or binary file based on the file extension.

Save As

This will allow you to choose a filename to save your code as. If the file already exists, it will prompt you if you want to overwrite the file. Keep in mind that you can name it anything you want, but it naming it with an unexpected extension could have unexpected results.

Save + Run

This options will save your file. If you are working on a file, it will prompt you to choose a filename and location. If you are working on code.py, it will send a Control+C and Control+D command to restart CircuitPython. If you are working on another filename, it will attempt to import the filename through the REPL.

Serial Mode

In serial mode, you can see the output of the CircuitPython device and even enter commands through the REPL.

Restart

This button will send a Control+C and Control+D to the device in order to soft restart CircuitPython.

Mobile Sizing

When the window is small enough, a mobile menu will appear as 3 bars in order to reduce the amount of screen real estate that the editor takes up. Additionally, only the filename and not the full path will be displayed.

Clicking on the menu will display the editor functions that were hidden allowing for full functionality even in mobile mode.

That's it! Enjoy using and if you would like to contribute to improving the editor, you can submit a Pull Request to https://github.com/circuitpython/web-editor.

This guide was first published on Nov 16, 2021. It was last updated on 2021-11-16 19:19:45 -0500.

This page (Usage) was last updated on Nov 27, 2021.

Text editor powered by tinymce.