3 Commits

Author SHA1 Message Date
4b765b0e9d Update missions/M8_5.py 2025-10-07 14:18:07 +00:00
2eca0d7d24 Initial commit
Mission Run #5
2025-10-07 14:18:07 +00:00
8949003351 Mission 9 not in use 2025-10-06 18:10:02 +00:00
3 changed files with 50 additions and 4 deletions

45
missions/Bautism.py Normal file
View File

@@ -0,0 +1,45 @@
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, run_task
hub = PrimeHub()
# Initialize both motors. In this example, the motor on the
# left must turn counterclockwise to make the robot go forward.
left_motor = Motor(Port.A, Direction.COUNTERCLOCKWISE)
right_motor = Motor(Port.B)
arm_motor = Motor(Port.D, Direction.CLOCKWISE)
arm_motor_left= Motor(Port.C, Direction.CLOCKWISE)
# Initialize the drive base. In this example, the wheel diameter is 56mm.
# The distance between the two wheel-ground contact points is 112mm.
drive_base = DriveBase(left_motor, right_motor, wheel_diameter=68.8, axle_track=180)
print('The default settings are: ' + str(drive_base.settings()))
drive_base.settings(300,1000,300,750)
# Optionally, uncomment the line below to use the gyro for improved accuracy.
drive_base.use_gyro(True)
async def main():
await drive_base.straight(519)
await arm_motor_left.run_angle(300, -100)
await arm_motor_left.run_angle(300, 500)
await drive_base.straight(180)
await drive_base.turn(-37)
await drive_base.straight(50)
await arm_motor.run_angle(300, -400)
await drive_base.straight(-150)
await drive_base.turn(135)
await drive_base.straight(50)
await arm_motor.run_angle(300, 400)
await drive_base.straight(-75)
await arm_motor.run_angle(300, 300)
await drive_base.turn(-50)
await drive_base.straight(162)
await arm_motor.run_angle(100, -200)
await drive_base.straight(30)
await arm_motor.run_angle(50,-500)
run_task(main())

View File

@@ -30,14 +30,14 @@ async def main():
await right_arm.run_angle(5000,-500, Stop.HOLD)
await drive_base.turn(-20)
await drive_base.straight(275)
await drive_base.straight(277)
await drive_base.turn(20)
await drive_base.straight(63)
await drive_base.straight(65)
await drive_base.turn(-30)
right_arm.run_angle(50,500)
await drive_base.turn(45)
await drive_base.straight(-135)
await drive_base.straight(-145)
await drive_base.turn(-60)
await drive_base.straight(90)
await left_arm.run_angle(1000,-450)
@@ -45,5 +45,5 @@ async def main():
await left_arm.run_angle(1000,450)
await drive_base.straight(10)
await drive_base.turn(35)
await drive_base.straight(-500)
await drive_base.straight(-600)
run_task(main())

View File

@@ -1,4 +1,5 @@
# ---JOHANNES---
# THIS CODE IS NOT USED ANYMORE AND SHOULD NOT BE USED!!!!!!
from pybricks.hubs import PrimeHub
from pybricks.pupdevices import Motor, ColorSensor, UltrasonicSensor, ForceSensor
from pybricks.parameters import Button, Color, Direction, Port, Side, Stop