-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsgeq7.h
66 lines (49 loc) · 1.42 KB
/
msgeq7.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
#ifndef __msgeq7__
#define __msgeq7__
#define resetPulseWidth 100
#define strobePulseWidth 18
#define resetToStrobeDelay 72
#define outputSettlingTime 36
#define strobeToStrobe 72
#define minFrequencyValue 120
#define maxFrequencyValue 1023
#define maxNumberOfFrequencies 7
#define minNumberOfFrequencies 1
#define floatingAverageLenght 10
#include <Arduino.h>
class msgeq7
{
private:
void reset();
void measureFrequency(byte frequencyNumber);
void chanceFrequency();
void filter();
void exponentialFloatingAverageFilter();
void lowValueReductionFilter();
void removeLowValuesAfterFilter();
boolean isInitialized;
boolean isFiltered;
byte numberOfFrequencies;
byte msg7AnalogInputPort;
byte msg7ResetPort;
byte msg7StrobePort;
byte index;
byte currentlyFilterProgramm;
int diffValueForExpFloatAvg;
int frequencyValue[floatingAverageLenght][maxNumberOfFrequencies];
float intervalVerlaufNonlinearLED;
public:
msgeq7(byte strobePort ,byte resetPort,byte inputPort);
void readFrequencies();
void setNumberOfFrequencies(byte newCount);
void setFilterProgramm(byte number);
byte getNumberOfFrequencies();
int getFrequency(byte frequencyNumber);
int getFrequency(String frequency);
int getMaxFrequency();
int getMinFrequency();
int getVolume();
double getRelativeFrequency(byte frequencyNumber);
double getFrequencyVoltage(byte frequencyNumber);
};
#endif