-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathautotune.cpp
67 lines (48 loc) · 995 Bytes
/
autotune.cpp
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
#include "autotune.h"
int ams_init()
{
return 0;
}
void ams_tuning()
{
int option=0, exectime;
/* Generate menu and input options */
Serial.println("This is the tuning module for the Microsmooth library.");
Serial.println("Please select a tuning function to use:");
Serial.println("(S)MA (E)MA (C)MA S(G)A (K)ZA (R)DP");
if (Serial.available() > 0)
{
option = Serial.read();
}
Serial.println("Enter the time within which the smoothing function may run:");
if (Serial.available() > 0)
{
exectime = Serial.parseInt();
/* TBD: Check for lower bound */
}
switch(option)
{
case 'S':ams_sma(exectime);
break;
case 'E':ams_ema(exectime);
break;
case 'C':;
break;
case 'G':;
break;
case 'K':;
break;
case 'R':;
break;
default:
Serial.println("Invalid option.");
}
}
int ams_sma(int maxtime)
{
return 0;
}
int ams_ema(int maxtime)
{
return 0;
}