-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReceptor_V1.0.ino
67 lines (57 loc) · 2.51 KB
/
Receptor_V1.0.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
////////////////////////////////////////////////////////////////////////////
// Titlu proiect: Smart Car (Radio control) //
// Autor: Aninu //
// Versiune: V 2.0 //
// URL: https://aninu.xyz/post/smart-car-v1/ //
// GitHub: https://github.com/aaninu/Arduino_Car //
////////////////////////////////////////////////////////////////////////////
/** Include librariile necesare. */
#include "Functions.h"
/** Initializarea setarilor generale si a pinilor. */
void setup(){
// Init Serial / Debug Mode
DebugMode_Setup();
// Init LEDs PIN Setup
LEDs_Setup();
// Init Motors PIN Setup
Motor_Setup();
// Init Buzzer PIN Setup
Buzzer_Setup();
// Init Sensor PIN Top/Bottom
Setup_SensorTop();
Setup_SensorBottom();
// Init Radio PIN Setup
Radio_Setup();
}
/** Pregatirea functiilor care trebuie executate in acelasi timp. */
TimedAction Timed_DebugMode_Serial = TimedAction(1, DebugMode_Serial);
TimedAction Timed_Radio_Receiver = TimedAction(1, Radio_Receiver);
TimedAction Timed_Control_LED_Pozitii = TimedAction(1, Control_LED_Pozitii);
TimedAction Timed_Control_LED_FazaLunga = TimedAction(1, Control_LED_FazaLunga);
TimedAction Timed_Control_LED_Stop = TimedAction(1, Control_LED_Stop);
TimedAction Timed_Control_LED_Left = TimedAction(1, Control_LED_Left);
TimedAction Timed_Control_LED_Right = TimedAction(1, Control_LED_Right);
TimedAction Timed_Control_LED_Avarii = TimedAction(1, Control_LED_Avarii);
TimedAction Timed_System_LED_LeftRight = TimedAction(1, System_LED_LeftRight);
TimedAction Timed_Control_Motor_Top = TimedAction(1, Control_Motor_Top);
TimedAction Timed_Control_Motor_Bottom = TimedAction(1, Control_Motor_Bottom);
TimedAction Timed_Control_Buzzer = TimedAction(1, Control_Buzzer);
TimedAction timed_S_T = TimedAction(1, Sensor_Top);
TimedAction timed_S_B = TimedAction(1, Sensor_Bottom);
/** Se pornesc toate functiile in acelasi timp. */
void loop(){
Timed_DebugMode_Serial.check();
Timed_Radio_Receiver.check();
Timed_Control_LED_Pozitii.check();
Timed_Control_LED_FazaLunga.check();
Timed_Control_LED_Stop.check();
Timed_Control_LED_Left.check();
Timed_Control_LED_Right.check();
Timed_Control_LED_Avarii.check();
Timed_System_LED_LeftRight.check();
Timed_Control_Motor_Top.check();
Timed_Control_Motor_Bottom.check();
Timed_Control_Buzzer.check();
timed_S_T.check();
timed_S_B.check();
}