From 5d57a3a17c3e32e22cb99f6ff0bd35b3b4f8bed9 Mon Sep 17 00:00:00 2001 From: Atharv <30nagava@elmbrookstudents.org> Date: Wed, 10 Sep 2025 13:49:02 +0000 Subject: [PATCH] Initial commit --- config.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 config.py 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