-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
111 lines (90 loc) · 2.59 KB
/
test.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import lightsensor
import led
import color
import motor
import linefollower
import gyro
import servo
import button
import utime
import grappler
import reset
import i2c
import tof
import calib
import escape_room
import escape_use
def measure_rate():
start = utime.ticks_ms()
for _ in range(1000):
lightsensor.measure_green_red()
lightsensor.measure_white()
color.get()
end = utime.ticks_ms()
print(end - start)
def run():
calib.load_from_file()
calib.show()
# lightsensor ##############################
# lightsensor.test_reflective()
# lightsensor.test_outer_diff()
# lightsensor.test_linefollower_diffs_all()
# lightsensor.test_all()
# lightsensor.test_white()
# lightsensor.test_red_green()
# lightsensor.test_red_green_calib()
# lightsensor.test_all_calib()
# lightsensor.test_green_red_diff()
# lightsensor.test_linefollower_diff()
# lightsensor.test_front_raw()
# color ####################################
# color.test()
# color.test_front()
# led ######################################
# led.test_status()
# led.set_status_left(led.OFF)
# led.set_status_right(led.OFF)
# linefollower #############################
# linefollower.test_linefollower()
# linefollower.test_turn_direction()
# linefollower.test_crossroad()
# linefollower.test_turn_angle()
# linefollower.drive_around_object(linefollower.LEFT)
# linefollower.test_watch_hover()
# linefollower.test_drive_forward_gyro()
# linefollower.test_ramp()
# gyro #####################################
# gyro.test()
gyro.test_accell_gyro()
# motor ####################################
# motor.test()
# motor.test_forward()
# servo ####################################
# servo.test(servo.FOUR)
# servo.test_all()
# servo.test180()
# button ###################################
# button.test()
# speed ####################################
# measure_rate()
# grappler
# grappler.down()
# i2c ######################################
# i2c.test()
# tof ######################################
# tof.test(tof.FOUR)
# tof.test_two_three()
# tof.time_one()
# escape ###################################
# escape_room.wall_follower()
# escape_room.find_line(2)
# escape_room.test_find_line2()
# escape_use
# escape_use.run()
# escape_use.drop_ball(escape_use.BALL_ALIVE)
pass
# TODO: gyro calibrierung an use case anpassen
# motoren drehen mit
if __name__ == "__main__":
reset.reset_hardware()
run()