Compare commits
4 Commits
ec745316e1
...
Scrimmage-
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e612e2325 | |||
| 4456a5aab4 | |||
| 08e0b9a521 | |||
| 4533f952ed |
@@ -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.
|
||||
|
||||
Read LICENSE for more information.
|
||||
34
missions/Lift.py
Normal file
34
missions/Lift.py
Normal 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())
|
||||
Reference in New Issue
Block a user