-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
52 lines (47 loc) · 1.14 KB
/
main.c
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
/*
* File: main.c
* Author: ethanblaylock
*
* Created on February 28, 2024, 5:10 PM
*/
#include "xc.h"
#include "line.h"
#include "canyon.h"
#include "start.h"
#include "collection.h"
#include "return.h"
#include "transmission.h"
#include "servicing.h"
int main(void) {
// States : FOLLOW_LINE, NAVIGATE_CANYON
setup();
while(1) {
_LATB7 = 1;
OC1R = servo_frequency; // Duty cycle
// Figures out what to do based on current state
switch(current_state) {
case START:
start();
break;
case FOLLOW_LINE:
followLine();
break;
case NAVIGATE_CANYON:
navigateCanyon();
break;
case COLLECT_SAMPLE:
collectSample();
break;
case RETURN_SAMPLE:
returnSample();
break;
case SERVICE_EQUIPMENT:
serviceEquipmentGun();
break;
case DATA_TRANSMISSION:
transmitData();
break;
}
}
return 0;
}