diff --git a/competition_codes/sectionals/sectional_main_experimental.py b/competition_codes/sectionals/sectional_main_experimental.py index dabb297..164ddc0 100644 --- a/competition_codes/sectionals/sectional_main_experimental.py +++ b/competition_codes/sectionals/sectional_main_experimental.py @@ -31,9 +31,6 @@ async def drive_backward(): """Drive forward continuously using DriveBase.""" drive_base.drive(400, 0) -async def async_drive(speed, direction): - drive_base.d - async def monitor_distance(): """Monitor ultrasonic sensor and stop when wall is detected.""" @@ -46,11 +43,14 @@ async def monitor_distance(): drive_base.stop() print(f"Wall detected at {distance}mm!") break + if distance is None: + continue + # Small delay to prevent overwhelming the sensor await wait(50) -# Experimental - Removed forge and who live here part +# Experimental - Removed forge and who lived here part async def Run1(): # From M8_5.py right_arm.run_angle(500,30) left_arm.run_angle(500,90)