Skip to main content

MicroPython

MicroPython is the text-based programming mode in the app.

When to use it​

Use MicroPython when you want to:

  • write detailed behavior directly
  • iterate on logic in code
  • build more advanced or precise routines

Toolbar​

The MicroPython toolbar contains several submenus:

Docs​

The Docs submenu provides built-in documentation for Dotbot Python functions.

Selecting a function opens a detailed view that:

  • lists and explains its input variables
  • provides example snippets
  • lets you copy snippets directly into the workspace

The full generated reference is available on the separate MicroPython API Reference page.

AI​

If enabled, the AI submenu provides helpers that can explain code, help with errors, and describe functions.

Two AI modes are available:

  • Code only: returns generated code without explanation
  • Teacher: returns generated code and also explains how it works

Generated code can be inserted directly into the workspace.

Terminal​

The Terminal submenu provides a live REPL feed to the robot MicroPython instance.

From there, you can immediately run commands, define functions, and interact with the robot runtime directly.

Control​

The Control submenu opens a mini control view for taking over direct control of the robot.

Editor​

The main MicroPython view presents an editor for writing scripts in the robot MicroPython environment.

All Dotbot-specific functionality is provided through the dotbot module.

You can import everything with:

import dotbot

Or import a specific feature module only, for example:

import dotbot.motor as motor

The editor provides autocomplete, type checking, and error reporting.

Errors are evaluated after the code is run on the robot.

Typical uses​

  • writing more detailed robot behavior
  • testing ideas directly in code
  • building more advanced routines than visual tools allow
  • moving from classroom-style programming to text-based programming

Position in the learning path​

MicroPython is the most advanced of the three app programming modes and is usually the next step after Blockly.