diff --git a/config.py b/config.py new file mode 100644 index 0000000..f59fbfb --- /dev/null +++ b/config.py @@ -0,0 +1,40 @@ +# config.py - Robot configuration shared across all modules +from pybricks.hubs import PrimeHub +from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor +from pybricks.parameters import Port + +# Initialize hub +hub = PrimeHub() + +# Robot hardware configuration +ROBOT_CONFIG = { + # Drive motors + 'left_motor': Motor(Port.A), + 'right_motor': Motor(Port.B), + + # Attachment motors + 'attachment_motor': Motor(Port.C), + 'lift_motor': Motor(Port.D), + + # Sensors + #'color_left': ColorSensor(Port.E), + 'color_back': ColorSensor(Port.F), + 'ultrasonic': UltrasonicSensor(Port.E), + + # Hub reference + 'hub': hub +} + +# Speed and distance constants +SPEEDS = { + 'FAST': 400, + 'NORMAL': 250, + 'SLOW': 100, + 'PRECISE': 50 +} + +DISTANCES = { + 'TILE_SIZE': 300, # mm per field tile + 'ROBOT_LENGTH': 180, # mm + 'ROBOT_WIDTH': 140 # mm +} \ No newline at end of file