from pybricks.robotics import DriveBase
# Create your drive base
robot = DriveBase(left_motor, right_motor, 56, 112)
# Get current settings
print("Default settings:", robot.settings())
# Customize for SPEED!
robot.settings(
straight_speed=500, # Max speed for straight (mm/s)
straight_acceleration=1000, # How fast to reach max speed
turn_rate=200, # Max turn speed (deg/s)
turn_acceleration=500 # How fast to reach max turn speed
)
# Customize for PRECISION (FLL missions!)
robot.settings(
straight_speed=200, # Slower = more accurate
straight_acceleration=100, # Gentle acceleration
turn_rate=90, # Careful turns
turn_acceleration=200
)
# Different speeds for different missions
def speed_mode(mode):
if mode == "FAST":
robot.settings(500, 1000, 200, 500)
hub.light.on(Color.RED)
elif mode == "PRECISE":
robot.settings(150, 100, 60, 150)
hub.light.on(Color.GREEN)
elif mode == "NORMAL":
robot.settings(300, 500, 120, 300)
hub.light.on(Color.BLUE)