You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
382 B
12 lines
382 B
9 years ago
|
Averaging float buffer
|
||
|
======================
|
||
|
|
||
|
*(You can adjust it to use doubles, if you prefer.)*
|
||
|
|
||
|
The `meanbuf_create()` function allocates a buffer.
|
||
|
|
||
|
You can then call `meanbuf_add()` to add a new value into the buffer (and remove the oldest).
|
||
|
This function returns the current average value.
|
||
|
|
||
|
This buffer can be used for **signal smoothing** (such as from an analogue sensor).
|