From c4aa9548ed64ec07c65feabc8d360d3a019781af Mon Sep 17 00:00:00 2001 From: Johannes <31liwaj@elmbrookstudents.org> Date: Fri, 12 Sep 2025 21:52:55 +0000 Subject: [PATCH 1/3] Boat mission --- missions/Boat.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 missions/Boat.py diff --git a/missions/Boat.py b/missions/Boat.py new file mode 100644 index 0000000..bb42eb7 --- /dev/null +++ b/missions/Boat.py @@ -0,0 +1,27 @@ +from pybricks.hubs import PrimeHub +from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor +from pybricks.parameters import Button, Color, Direction, Port, Side, Stop +from pybricks.robotics import DriveBase +from pybricks.tools import wait, StopWatch +from pybricks.tools import run_task,multitask + +hub = PrimeHub() + +left_motor = Motor(Port.A, Direction.COUNTERCLOCKWISE) +right_motor = Motor(Port.B) +left_arm = Motor(Port.C, Direction.COUNTERCLOCKWISE) +right_arm = Motor(Port.D) + +drive_base = DriveBase(left_motor, right_motor, wheel_diameter=68.8, axle_track=180) + +drive_base.settings(550,700,100,100) + +drive_base.use_gyro(True) + +first_run = False + +async def main(): + await drive_base.straight(750) + await drive_base.straight(-650) + +run_task(main()) \ No newline at end of file From e8176500f90f5b7bac5857c154b0b4190cdad788 Mon Sep 17 00:00:00 2001 From: Johannes <31liwaj@elmbrookstudents.org> Date: Fri, 12 Sep 2025 21:54:15 +0000 Subject: [PATCH 2/3] Send Over --- missions/Send_Over.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/missions/Send_Over.py b/missions/Send_Over.py index a769f1d..97bed5f 100644 --- a/missions/Send_Over.py +++ b/missions/Send_Over.py @@ -13,22 +13,19 @@ right_motor = Motor(Port.B) left_arm = Motor(Port.C, Direction.COUNTERCLOCKWISE) right_arm = Motor(Port.D) -drive_base = DriveBase(left_motor, right_motor, wheel_diameter=64.8, axle_track=180) +drive_base = DriveBase(left_motor, right_motor, wheel_diameter=68.8, axle_track=180) drive_base.settings(600,500,300,200) drive_base.use_gyro(True) async def main(): - await drive_base.straight(855) + await drive_base.straight(915) await drive_base.turn(-90) - await drive_base.straight(50) + await drive_base.straight(60) await left_arm.run_angle(10000,-15000) - await drive_base.straight(-50) - await drive_base.turn(90) + await drive_base.straight(-60) + await drive_base.turn(85) await drive_base.straight(2000) - - - run_task(main()) \ No newline at end of file From 7eeead7d99aabbd4d88c284bb1c20c4319789472 Mon Sep 17 00:00:00 2001 From: Johannes <31liwaj@elmbrookstudents.org> Date: Fri, 12 Sep 2025 21:55:38 +0000 Subject: [PATCH 3/3] Sand Mission --- missions/Sand Mission.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 missions/Sand Mission.py diff --git a/missions/Sand Mission.py b/missions/Sand Mission.py new file mode 100644 index 0000000..73e1e16 --- /dev/null +++ b/missions/Sand Mission.py @@ -0,0 +1,29 @@ +from pybricks.hubs import PrimeHub +from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor +from pybricks.parameters import Button, Color, Direction, Port, Side, Stop +from pybricks.robotics import DriveBase +from pybricks.tools import wait, StopWatch +from pybricks.tools import run_task,multitask + +hub = PrimeHub() + +left_motor = Motor(Port.A, Direction.COUNTERCLOCKWISE) +right_motor = Motor(Port.B) +left_arm = Motor(Port.C, Direction.COUNTERCLOCKWISE) +right_arm = Motor(Port.D) + +drive_base = DriveBase(left_motor, right_motor, wheel_diameter=68.8, axle_track=180) + +drive_base.settings(400,500,100,100) + +drive_base.use_gyro(True) + + +async def main(): + await drive_base.straight(420) + await right_arm.run_angle(300,-100) + await drive_base.straight(-100) + await right_arm.run_angle(300, 100) + await drive_base.straight(-350) + +run_task(main()) \ No newline at end of file