-
Notifications
You must be signed in to change notification settings - Fork 12
/
TrackerGCS.h
74 lines (54 loc) · 1.85 KB
/
TrackerGCS.h
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
#ifndef TRACKERGCS_H
#define TRACKERGCS_H
#include <LiquidCrystal.h>
#include <Servo.h>
#include <pins_arduino.h>
#define numberOfRSSISamples 10
#define minTrackingDistance 5 // Minimum distance in meters before tracking will start
#define verticalServoPin 10
#define horizontalServoPin 11
#define verticalServo 0
#define horizontalServo 1
#define GPSTrackingMode 0
#define RSSITrackingMode 1
#define AeroQuadProtocol 0
#define MikrokopterProtocol 1
const int battMonitorPin = A2;
// Telemetry variables
extern int32_t uavLatitude; // latitude
extern int32_t uavLongitude; // longitude
extern unsigned char uavSatellitesVisible; // number of satelites
extern int16_t uavAltitude; // altitude (dm)
// Home positioning data
extern int32_t homeLongitude;
extern int32_t homeLatitude;
extern int32_t uavDistanceToHome;
extern unsigned int homeBearing;
// Status indicators
extern bool uavHasGPSFix;
extern bool isTelemetryOk;
extern long lastPacketReceived;
extern LiquidCrystal lcd;
// Tracking variables
extern unsigned int trackingBearing;
extern unsigned int trackingElevation;
const unsigned int verticalMin = 0;
const unsigned int verticalMax = 120;
const unsigned int verticalMid = (verticalMin + verticalMax) / 2;
const unsigned int horizontalMin = 15;
const unsigned int horizontalMax = 170;
const unsigned int horizontalMid = (horizontalMin + horizontalMax) / 2;
const int rssiTrackPin = A0;
const int rssiFixPin = A1;
extern unsigned char rssiTrack;
extern unsigned char rssiFix;
extern unsigned char rssiTrackOld;
extern unsigned char i;
extern unsigned char y;
extern unsigned char horizontalDirection;
extern unsigned char verticalDirection;
extern Servo VerticalServo;
extern Servo HorizontalServo;
extern unsigned char protocolType;
extern void applyServoCommand(int servo, unsigned int value);
#endif