-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.c
executable file
·68 lines (67 loc) · 1.49 KB
/
main.c
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
#include "functions.h"
int main() {
init(5);
shut_down_in(100.0);
create_direct_left();
while(isdark_front() == false) {
create_drive_straight(create_forward_speed);
}
while(isdark_right() + isdark_left() < 1) {
create_drive_straight(create_forward_speed_slow);
}
create_black_align();
thread_start_lower_claw();
while(isdark_front() == false) {
create_spin_CCW(create_turn_speed_slow);
}
create_spin_CW(create_turn_speed_slow);
msleep(10);
create_stop();
thread_wait(lc);
while(ispressed_claw() == false) {
create_drive_straight(create_forward_speed_slow);
}
create_stop();
close_claw();
thread_start_raise_claw_timed();
create_spin_CCW(create_turn_speed_slow);
msleep(50);
create_go(1250);
thread_destroy(rc);
create_direct_left();
create_spin_CCW(create_turn_speed_slow);
msleep(50);
create_go(80);
open_claw();
thread_start_raise_claw();
create_go(180);
thread_destroy(rc);
thread_start_lower_claw();
create_go(-200);
half_claw();
create_direct_left();
sleep(10);
create_go(950);
create_direct_left();
create_spin_CCW(create_turn_speed_slow);
msleep(90);
create_stop();
lower_claw();
while(ispressed_claw() == false) {
create_drive_straight(create_forward_speed_very_slow);
}
create_stop();
close_claw();
raise_claw_timed();
create_go(-260);
thread_start_raise_claw();
create_direct_left();
create_go(960);
create_direct_left();
create_spin_CCW(create_turn_speed_slow);
msleep(20);
create_stop();
create_go(75);
create_stop();
lower_claw_timed();
}