-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainProgram.m
72 lines (67 loc) · 1.44 KB
/
mainProgram.m
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
clear all;
a = arduino();
clear a;
a = arduino('COM3', 'Uno');
R1='D13';
G1='D12';
Y1='D11';
R2='D10';
G2='D9';
Y2='D8';
R3='D7';
G3='D6';
Y3='D5';
R4='D4';
G4='D3';
Y4='D2';
Th=5;
for i=1:10
Green1(a,R1,G1,Y1);
Red2(a,R2,G2,Y2)
Red3(a,R3,G3,Y3)
Red4(a,R4,G4,Y4)
pause(5)
[c1,c2,c3,c4]=CountCar();
eLights(c1,c2,c3,c4,Th,a,R1,Y1,G1,R2,G2,Y2,R3,G3,Y3,G4,Y4,R4)
Yellow1(a,R1,G1,Y1);
Red2(a,R2,G2,Y2)
Red3(a,R3,G3,Y3)
Red4(a,R4,G4,Y4)
pause(3)
Red1(a,R1,G1,Y1);
Green2(a,R2,G2,Y2)
Red3(a,R3,G3,Y3)
Red4(a,R4,G4,Y4)
pause(5)
[c1,c2,c3,c4]=CountCar();
eLights(c1,c2,c3,c4,Th,a,R1,Y1,G1,R2,G2,Y2,R3,G3,Y3,G4,Y4,R4)
Red1(a,R1,G1,Y1);
Yellow2(a,R2,G2,Y2)
Red3(a,R3,G3,Y3)
Red4(a,R4,G4,Y4)
pause(3)
Red1(a,R1,G1,Y1);
Red2(a,R2,G2,Y2)
Green3(a,R3,G3,Y3)
Red4(a,R4,G4,Y4)
pause(5)
[c1,c2,c3,c4]=CountCar();
eLights(c1,c2,c3,c4,Th,a,R1,Y1,G1,R2,G2,Y2,R3,G3,Y3,G4,Y4,R4)
Red1(a,R1,G1,Y1);
Red2(a,R2,G2,Y2)
Yellow3(a,R3,G3,Y3)
Red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