Text-Based Programming

MRXcode Python

Write real Python code to control your robots. Full-featured IDE with autocomplete, debugging, and the powerful MRX Robot API.

Python 3.11 Supported
200+ API Functions
Pro Debugging Tools
Python Coding

Professional Python Environment

Everything you need to write, test, and deploy Python code to MRX robots

Full Python 3.11

Standard Python with all the features you'd expect — classes, functions, modules, and more.

Smart Autocomplete

IntelliSense-style autocomplete suggests methods, parameters, and documentation as you type.

Visual Debugger

Set breakpoints, step through code, inspect variables, and watch expressions in real-time.

Interactive Console

Test code snippets instantly in the REPL. Perfect for experimenting with robot commands.

Real-Time Error Checking

Syntax errors are highlighted as you type. Never upload broken code to your robot.

Version Control

Built-in Git integration for tracking changes and collaborating with teammates.

MRX Robot API

Comprehensive Python library for controlling every aspect of your MRX robot

mrx.motor

Control individual motors, set speeds, positions, and read encoder values.

motor.spin(100, RPM)

mrx.drivetrain

High-level drive commands for movement, turning, and autonomous navigation.

drivetrain.drive_for(12, INCHES)

mrx.sensor

Read from distance, color, touch, gyro, and all other MRX sensors.

distance.object_distance(MM)

mrx.brain

Display text, graphics, and images on the robot brain screen.

brain.screen.print("Hello!")

mrx.controller

Read joystick values and button presses from the wireless controller.

controller.axis1.position()

mrx.vision

Computer vision for object detection, color tracking, and AI features.

vision.take_snapshot(OBJECTS)

See Python in Action

A simple autonomous driving program in MRXcode Python

# MRXcode Python - Autonomous Line Follower
from mrx import *

# Configure devices
brain = Brain()
left_motor = Motor(Ports.PORT1)
right_motor = Motor(Ports.PORT2)
line_sensor = LineTracker(brain.three_wire_port.a)

# Create drivetrain
drivetrain = DriveTrain(left_motor, right_motor)

def follow_line():
    """Follow a black line on the ground"""
    while True:
        # Read line sensor value (0-100)
        value = line_sensor.reflectivity()
        
        if value > 50:
            # On line - drive straight
            drivetrain.drive(FORWARD)
        else:
            # Off line - turn to find it
            drivetrain.turn(RIGHT, 20)
        
        wait(20, MSEC)

# Run the program
follow_line()

From Blocks to Python

A natural progression path for students ready for text-based coding

1

Master Blocks

Build a strong foundation with visual programming concepts

2

View as Code

Use the blocks-to-code toggle to see Python equivalents

3

Edit Code

Start making small changes to generated Python code

4

Write Python

Create programs from scratch in the Python environment

Ready for Real Code?

Download MRXcode Studio and start writing Python for your robots