Revision eb7af729
Arduino code measures PWM up and PWM down time, and if U+D!= contant, we reject the signal
arduino/RadioBuggyMega/filter.h | ||
---|---|---|
13 | 13 |
extern "C"{ |
14 | 14 |
#endif |
15 | 15 |
|
16 |
#define FILTER_LEN 5 // Averaging window size |
|
16 |
//<<<<<<< Updated upstream |
|
17 |
#define FILTER_LEN 10 // Averaging window size |
|
17 | 18 |
|
18 | 19 |
struct filter_state { |
19 | 20 |
int prev_values[FILTER_LEN]; |
... | ... | |
25 | 26 |
void filter_init(struct filter_state *state); |
26 | 27 |
|
27 | 28 |
int filter_loop(struct filter_state *state, int val); // returns the int that has been filtered |
29 |
//======= |
|
30 |
//// @param val The next raw reading |
|
31 |
//// @returns The next filtered reading |
|
32 |
//int filter(int new_raw_reading); |
|
33 |
// |
|
34 |
//>>>>>>> Stashed changes |
|
28 | 35 |
|
29 | 36 |
|
30 | 37 |
#ifdef __cplusplus |
Also available in: Unified diff