GY-63_MS5611/libraries/MINMAX
2021-10-14 14:54:11 +02:00
..
.github/workflows 0.1.0 MINMAX 2021-10-14 14:54:11 +02:00
examples 0.1.0 MINMAX 2021-10-14 14:54:11 +02:00
test 0.1.0 MINMAX 2021-10-14 14:54:11 +02:00
.arduino-ci.yml 0.1.0 MINMAX 2021-10-14 14:54:11 +02:00
keywords.txt 0.1.0 MINMAX 2021-10-14 14:54:11 +02:00
library.json 0.1.0 MINMAX 2021-10-14 14:54:11 +02:00
library.properties 0.1.0 MINMAX 2021-10-14 14:54:11 +02:00
LICENSE 0.1.0 MINMAX 2021-10-14 14:54:11 +02:00
MINMAX.h 0.1.0 MINMAX 2021-10-14 14:54:11 +02:00
README.md 0.1.0 MINMAX 2021-10-14 14:54:11 +02:00

Arduino CI Arduino-lint JSON check License: MIT GitHub release

MINMAX

Library for finding peaks (minimum and maximum) in signal.

Description

The MINMAX library is a simple peak finder in a stream of floats.

It indicates if after adding a number the minimum and/or the maximum value has been changed by means of a bit flag that is returned. If a peak is found, it will be used as the new reference untila a reset.

The library can reset the minimum and maximum to 0 to start again.

The library has also the option to auto-reset after a predefined number of add() calls.

Interface

  • MINMAX Constructor
  • uint8_t add(float f) add next value. Returns status (bit flags), see table below.
  • void reset() resets the minimum and maximum to 0.
  • void autoReset(uint32_t cnt) sets an auto-reset moment after cnt calls to add().
    There will be at least one value processed.
  • float minimum() returns last minimum. Can be higher than previous call due to reset() or autoReset().
    If no call to add() is made it will return 0.
  • float maximum() returns last maximum. Can be lower than previous call due to reset() or autoReset().
    If no call to add() is made it will return 0.
  • uint32_t count() returns nr of add() calls since last (auto)reset.

Return values of add()

flag description
0x00 no change
0x01 minimum changed
0x02 maximum changed
0x80 reset done

Operation

The examples show the basic working of the functions.

Future

  • update documentation
  • define FLAGS
  • add call back functions?
  • thresholds, windowing + triggers (separate class?)
  • auto-reset after time? (would affect all functions)