-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
64 lines (52 loc) · 1.21 KB
/
main.cpp
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
#include "mbed.h"
#include "Data.h"
#include "State.h"
#include "Apogee.h"
#include "PreFlight.h"
#include "Separation.h"
#include "PoweredAscent.h"
#include "CoastAscent1.h"
#include "CoastAscent2.h"
#include "CoastDescent.h"
#include "DrogueDeploy.h"
#include "DrogueDescent.h"
#include "MainDeploy.h"
#include "MainDescent.h"
#include "PostFlight.h"
int main()
{
Data data;
int stateNum = 0;
PreFlight preFlight;
PoweredAscent poweredAscent1;
Separation separation;
CoastAscent1 coastAscent1;
PoweredAscent poweredAscent2;
CoastAscent2 coastAscent2;
Apogee apogee;
CoastDescent coastDescent;
DrogueDeploy drogueDeploy;
DrogueDescent drogueDescent;
MainDeploy mainDeploy;
MainDescent mainDescent;
PostFlight postFlight;
State states[] = {preFlight,
poweredAscent1,
separation,
coastAscent1,
poweredAscent2,
coastAscent2,
apogee,
coastDescent,
drogueDeploy,
drogueDescent,
mainDeploy,
mainDescent,
postFlight};
while(1) {
data.getData();
data.processData();
stateNum += states[stateNum].run(&data);
wait_ms(50);
}
}