This repository has been archived by the owner on Mar 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCore.ino
84 lines (66 loc) · 1.52 KB
/
Core.ino
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
#include "pch.h"
#include "RobotConfig.h"
void setup()
{
Serial1.begin(9600);
Serial4.begin(115200);
ColorSensorInit();
MotorInit();
ServoInit();
QRScanner.Reset();
delay(500);
BlueLED.Off();
// Buzzer.Beep(2000, 2000);
//=======================================
//
// ### ## ## ###### #####
// ## ## ## ## ## ## ##
// ## ## ## ## ## ## ##
// ####### ## ## ## ## ##
// ## ## ##### ## #####
//
//=======================================
Start();
TaskOne_CollectPhase1();
TaskOne_CollectPhase2();
TaskOne_CollectPhase3();
TaskOne_CollectPhase4();
BackToCenter();
TaskOne_PlacePhase1();
TaskOne_PlacePhase2();
TaskOne_PlacePhase3();
TaskOne_PlacePhase4();
BackToHome();
TasKTwo_Start();
TaskTwo_MovePhase1();
TaskTwo_MovePhase2();
TaskTwo_MovePhase3();
TaskTwo_Collect();
// LeftOpenRoute or RightOpenRoute
if (EPosition != BLUE)
{
TaskTwo_PlacePhase1_LeftOpen();
TaskTwo_PlacePhase2_LeftOpen();
TaskTwo_PlacePhase3_LeftOpen();
TaskTwo_PlacePhase4_LeftOpen();
FinalHome_LeftOpen();
}
else
{
TaskTwo_PlacePhase1_RightOpen();
TaskTwo_PlacePhase2_RightOpen();
TaskTwo_PlacePhase3_RightOpen();
TaskTwo_PlacePhase4_RightOpen();
FinalHome_RightOpen();
}
//*/
// GoDistance(400, 400);
Stop();
}
void loop()
{
BlueLED.Toggle();
GreenLED.Toggle();
Buzzer.Beep(440, 50);
delay(200);
}