-
Notifications
You must be signed in to change notification settings - Fork 3
/
modeDefinition.ino
76 lines (64 loc) · 1.86 KB
/
modeDefinition.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
//Declare essential fns (On at all times, regardless of the mode)
int gammaSat::essentialFunctions()
{
satAttitude = ADCS.determineAttitude();
satPosition = ADCS.determinePosition();
COMsystem.controlLoop();
COMsystem.beaconSignal();
}
//This will define each mode of operation
//These functions should return 0 to indicate no error, otherwise it will return -1 to indicate that
//there has been an error, in which case the gammaSat system will return to Safe mode
//Normal Mode
//All subsystems operational except for payload
//Activated after the inital recovery and detumble phases
//Wait for command from ground station
int gammaSat::normalMode()
{
gammaSat.essentialFunctions();
}
//Recovery Mode
//Beacon transmit, receive commands, GPS and attitude control
//Comunication with ground station initialised
int gammaSat::recoveryMode()
{
gammaSat.essentialFunctions();
}
//Safe Mode
//Beacon transmit, receive commmands, GPS and attitude control
int gammaSat::safeMode()
{
gammaSat.essentialFunctions();
}
//Science Mode
//Beacon transmit, receive commmands, GPS and attitude control
//Science payload ON
int gammaSat::scienceMode()
{
gammaSat.essentialFunctions();
Payload.senseGamma();
}
//Transmit Mode
//Beacon transmit, receive commmands, GPS and attitude control
//Transmit all data to ground station, when gammaSat is in view of the ground station
int gammaSat::transmissionMode()
{
gammaSat.essentialFunctions();
COMSystem.sendData();
}
//Technology Mode
//Beacon transmit, receive commmands, GPS and attitude control
//Technology payload ON
int gammaSat::technologyMode()
{
gammaSat.essentialFunctions();
gammaSat.techPayload();
}
//Checkout Mode
//Beacon transmit, receive commmands, GPS and attitude control
//Diagnostic of all satellite components
int gammaSat::technologyMode()
{
gammaSat.essentialFunctions();
Status = gammaSat.diagnostic();
}