-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtransmitter.h
64 lines (47 loc) · 974 Bytes
/
transmitter.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
#ifndef TRANSMITTER_CONTROLLER_H
#define TRANSMITTER_CONTROLLER_H
#include <Arduino.h>
struct TransmitterData
{
float elapsedTime;
float accX;
float accY;
float accZ;
float gyroX;
float gyroY;
float gyroZ;
float magX;
float magY;
float magZ;
float altitude;
float temp;
int32_t yaw;
int32_t pitch;
int32_t roll;
int32_t rcThrottle;
int32_t rcYaw;
int32_t rcPitch;
int32_t rcRoll;
int32_t frontRight;
int32_t backRight;
int32_t backLeft;
int32_t frontLeft;
float kp_r;
float ki_r;
float kd_r;
// float kp_p;
// float ki_p;
// float kd_p;
};
class TransmitterController
{
private:
unsigned long lastTransmitTime;
const unsigned long transmitInterval = 20; // Print every 100ms
void sendData(TransmitterData data);
public:
TransmitterController();
void transmitData(TransmitterData data);
String receiveData();
};
#endif