-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvents.ino
62 lines (57 loc) · 871 Bytes
/
Events.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
void Calculate_Events()
{
if ( ! is_launched)
{
calLaunch();
}
else if ( ! descent && ! parachute)
{
calTrajSec();
calDescent();
}
else if ( ! parachute)
{
dplParachute();
}
else if ( ! touchdown)
{
calTouchdown();
}
}
void calLaunch()
{
if (!is_launched && vector_module(accel) > 500) //TODO new values with new resolution
{
is_launched = true;
launch = millis();
Serial.println("Launch!!");
//TODO change accelerometer resolution
}
}
void calTrajSec()
{
//TODO
}
void calDescent()
{
if (!descent && millis() > launch + 5000)
{
descent = true;
descentStart = millis();
}
//TODO
}
void dplParachute()
{
if (!parachute && millis() > descentStart + 500)
{
myservo.write(180);
parachute = true;
parachuteDepl = millis();
}
//TODO
}
void calTouchdown()
{
//TODO
}