Pynamics — Pybricks Utilities for FLL SPIKE Prime robots
A collection of Pybricks utilities to assist in your FLL robot programming with Python.
Created by FLL Team 65266 — Lego Dynamics.
What is Pynamics?
Pynamics is an open-source toolkit built for Pybricks that helps FIRST LEGO League (FLL) teams write, test, and diagnose their robot programs in Python. It provides ready-to-use diagnostic tools, starter templates, and an experimental IDE designed to simplify the development workflow.
The project is hosted on the Lego Dynamics Git Server and is being actively developed by the team.
Getting Started
Download & Install
- Go to the repository and click Code → Download ZIP.
- Unzip the archive on your computer.
- Open code.pybricks.com in your browser.
- Use the Import button in Pybricks to open the files from whichever folder you need.
- Connect your SPIKE Prime Hub (currently the only supported hub) and press Run.
Alternatively, clone via Git:
git clone https://codes.fll-65266.org/Arcmyx/pynamics.git
Note: A custom Pynamics IDE is currently in development. It will automatically fetch the latest pre-compiled bytecode, send it directly to your robot, and provide a formatted output viewer — eliminating the manual import steps described above.
Utilities
Diagnostics
The diagnostics/ folder contains a comprehensive set of programs for testing individual robot components. To use them:
- Import all files in the
diagnostics/folder into Pybricks (you can select them all at once). - Switch to
full_diagnostics.pyand press Run. - Follow the on-screen instructions.
Note: Compilation may take a moment — the diagnostics suite imports thousands of lines of code. This is one of the key problems the upcoming Pynamics IDE will solve by distributing pre-compiled bytecode.
Diagnostic Modules
| File | What It Tests |
|---|---|
full_diagnostics.py |
Entry point — runs the complete diagnostic suite |
hub_diagnostics.py |
Hub status, firmware, and system info |
battery_diagnostics.py |
Battery voltage and charge level |
motor_diagnostics.py |
Motor ports, rotation, and speed |
drive_base_diagnostics.py |
Drive base movement and calibration |
color_sensor_diagnostics.py |
Color sensor readings and detection |
micropython_diagnostics.py |
MicroPython environment info |
os_diagnostics.py |
Operating system / MicroPython internals rigorous testing |
other_functions.py |
Shared helper functions used by other modules |
Templates
The templates/ folder provides boilerplate code to jumpstart common FLL programming patterns.
Experiments & Tests
Located in the experiments/ and tests/ folders, respectively, the former is for interesting ideas or just-for-fun things, and the latter is for storing tiny, temporary files for developers to test new features.
Display Tips
For the best experience with the ASCII art UI used in the diagnostics tool, set your Pybricks window zoom to 90% on smaller screens (the upcoming Pynamics IDE will fix all of this).
License
Pynamics is licensed under the Creative Commons Attribution 4.0 International (CC BY 4.0).
You are free to:
- Share — copy and redistribute the material in any medium or format.
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
Under the following condition:
- Attribution — You must give appropriate credit, link to this repository, and indicate if changes were made. Do not claim the work as your own.
See the LICENSE file for full legal details.
Links
Made by FLL Team 65266 — Lego Dynamics