-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpid.cpp
More file actions
27 lines (21 loc) · 844 Bytes
/
pid.cpp
File metadata and controls
27 lines (21 loc) · 844 Bytes
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
#include "./pid.h"
// point plotter with the boundries already set
// just paste the content of altitude.out in the text box and the points will be plotted
// http://fooplot.com#W3sidHlwZSI6MywiZXEiOltdLCJjb2xvciI6IiMwMDAwMDAifSx7InR5cGUiOjEwMDAsIndpbmRvdyI6WyItMTkuOTA5MDY5ODk2NDQ5NTEiLCIxMDYyLjM4NTEwMDc3NjYyNzMiLCItMTg1Ni4xMzY3Nzk3ODUxNTQ0IiwiMTc5Ni44MTczMjE3NzczNDU2Il19XQ--
// mentions, you can only use the following functions
// to get the error from the target altitude
// double read_error(void)
// to give commands to the mottors
// valid input: 0 - 4000
// void set_motor_command(int command)
void loop() {
// TO_DO
// a PID controller
set_motor_command(5000);
}
void set_motor_command(int command) {
Linker::get_instance()->give_command(command);
}
double read_error() {
return Linker::get_instance()->get_error();
}