4 Commits

Author SHA1 Message Date
1e612e2325 Updated license information 2025-10-09 12:23:15 +00:00
4456a5aab4 Merge pull request 'Johannes_Dev' (#9) from Johannes_Dev into dev
Reviewed-on: #9
2025-10-08 23:23:13 +00:00
08e0b9a521 Delete missions/Lift2.py 2025-10-08 23:21:43 +00:00
4533f952ed Add stuff from Johannes accidental fork 2025-10-07 12:32:40 +00:00
2 changed files with 38 additions and 1 deletions

View File

@@ -22,4 +22,7 @@ Load the master file into PyBricks, then send it over to the robot. Then you hol
## License
GNU General Public License
You can take inspiration from our code, but you can't take our exact code.
You can take inspiration from our code, but you can't take our exact code.
Read LICENSE for more information.

34
missions/Lift.py Normal file
View File

@@ -0,0 +1,34 @@
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(600,500,300,200)
drive_base.use_gyro(True)
async def main():
await drive_base.straight(200)
await drive_base.turn(-20)
await drive_base.straight(525)
await drive_base.turn(60)
await drive_base.straight(50)
await right_arm.run_angle(2000,1000)
await drive_base.straight(-50)
await drive_base.turn(45)
await drive_base.straight(50)
await right_arm.run_angle(350,-1000)
await drive_base.turn(-100)
await drive_base.straight(-600)
run_task(main())