exec
Run MicroPython code on a connected board and capture its output, including prints and tracebacks. Stops any running program first, with a configurable timeout to prevent hangs.
Instructions
Run MicroPython code on the board and return its output (prints and tracebacks). When Thonny is open, the code appears in its shell highlighted as coming from the AI, exactly like a student typing it. Stops the program currently running first. timeout in seconds (default 10, max 300); on timeout the code is interrupted. For programs that loop forever (robots, sensor streams) use start + monitor.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| timeout | No |