Write real Python code to control your robots. Full-featured IDE with autocomplete, debugging, and the powerful MRX Robot API.
Everything you need to write, test, and deploy Python code to MRX robots
Standard Python with all the features you'd expect — classes, functions, modules, and more.
IntelliSense-style autocomplete suggests methods, parameters, and documentation as you type.
Set breakpoints, step through code, inspect variables, and watch expressions in real-time.
Test code snippets instantly in the REPL. Perfect for experimenting with robot commands.
Syntax errors are highlighted as you type. Never upload broken code to your robot.
Built-in Git integration for tracking changes and collaborating with teammates.
Comprehensive Python library for controlling every aspect of your MRX robot
Control individual motors, set speeds, positions, and read encoder values.
motor.spin(100, RPM)
High-level drive commands for movement, turning, and autonomous navigation.
drivetrain.drive_for(12, INCHES)
Read from distance, color, touch, gyro, and all other MRX sensors.
distance.object_distance(MM)
Display text, graphics, and images on the robot brain screen.
brain.screen.print("Hello!")
Read joystick values and button presses from the wireless controller.
controller.axis1.position()
Computer vision for object detection, color tracking, and AI features.
vision.take_snapshot(OBJECTS)
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()
A natural progression path for students ready for text-based coding
Build a strong foundation with visual programming concepts
Use the blocks-to-code toggle to see Python equivalents
Start making small changes to generated Python code
Create programs from scratch in the Python environment
Download MRXcode Studio and start writing Python for your robots