-
Notifications
You must be signed in to change notification settings - Fork 0
/
run1.py
59 lines (51 loc) · 1.23 KB
/
run1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env pybricks-micropython
from setup import *
from functions import *
from attachmentfunctions import *
# GYRO_LEFT(angle)
# GYRO_RIGHT(angle)
# GYRO_STRAIGHT(speed, time)
# GYRO_STRAIGHT_DISTANCE(speed, distance)
# GYRO_HOLD(time)
# Motor Controls:
# motor.stop()
# motor.hold()
# motor.run(speed)
# motor.run_time(speed,time)
# motor.run_target(speed, angle)
# motor.run_until_stalled(speed)
# Touch Sensor:
# sensor.pressed()
# Color Sensor
# sensor.color()
# sensor.ambient()
# sensor.reflection()
# sensor.rgb()
# Ultrasonic Sensor:
# sensor.distance(silent=True/False)
# sensor.presence()
# Gyroscopic Sensor
# sensor.speed()
# sensor.angle()
# sensor.reset_angle(angle)
# RESET_ATTACHMENT(side) {left / right}
# ATTACHMENT_SCOOP(direction) {up / down}
# ATTACHMENT_LEVER1(direction) {up / down}
# RIGHT_ATTACHMENT(speed, angle)
# LEFT_ATTACHMENT(speed, angle)
# ---------------------------------------------------------------
PLAY_NOTES("confirm")
RESET_ATTACHMENT("left")
GYRO_STRAIGHT_DISTANCE(400, 510)
DRIVE_STOP()
left_attachment_motor.run_until_stalled(-500)
wait(300)
robot.drive(-170,-200)
wait(300)
DRIVE_STOP()
left_attachment_motor.run_until_stalled(500)
robot.drive(-8, 200)
wait(300)
robot.drive(600,0)
wait(2000)
DRIVE_STOP()