Update competition_codes/sectionals/sectional_main_experimental.py

This commit is contained in:
2025-11-25 20:23:48 +00:00
parent d4e44bb53f
commit 05be290f90

View File

@@ -31,9 +31,6 @@ async def drive_backward():
"""Drive forward continuously using DriveBase.""" """Drive forward continuously using DriveBase."""
drive_base.drive(400, 0) drive_base.drive(400, 0)
async def async_drive(speed, direction):
drive_base.d
async def monitor_distance(): async def monitor_distance():
"""Monitor ultrasonic sensor and stop when wall is detected.""" """Monitor ultrasonic sensor and stop when wall is detected."""
@@ -46,11 +43,14 @@ async def monitor_distance():
drive_base.stop() drive_base.stop()
print(f"Wall detected at {distance}mm!") print(f"Wall detected at {distance}mm!")
break break
if distance is None:
continue
# Small delay to prevent overwhelming the sensor # Small delay to prevent overwhelming the sensor
await wait(50) 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 async def Run1(): # From M8_5.py
right_arm.run_angle(500,30) right_arm.run_angle(500,30)
left_arm.run_angle(500,90) left_arm.run_angle(500,90)