mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.2.1 MINMAX
This commit is contained in:
parent
6d788ddcfd
commit
725b6fff88
@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.2.1] - 2023-11-14
|
||||
- update readme.md
|
||||
- update examples
|
||||
|
||||
|
||||
## [0.2.0] - 2022-12-07
|
||||
- fix #6 split in .cpp and .h
|
||||
- remove obsolete autoReset()
|
||||
@ -14,7 +19,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- update unit test
|
||||
- update examples
|
||||
|
||||
|
||||
----
|
||||
|
||||
## [0.1.3] - 2022-11-17
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FILE: MINMAX.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.0
|
||||
// VERSION: 0.2.1
|
||||
// DATE: 2021-10-14
|
||||
// PURPOSE: MINMAX library - simple peak finder
|
||||
// URL: https://github.com/RobTillaart/MINMAX
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// FILE: MINMAX.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.2.0
|
||||
// VERSION: 0.2.1
|
||||
// DATE: 2021-10-14
|
||||
// PURPOSE: MINMAX library - simple peak finder
|
||||
// URL: https://github.com/RobTillaart/MINMAX
|
||||
@ -10,7 +10,7 @@
|
||||
|
||||
#include "Arduino.h"
|
||||
|
||||
#define MINMAX_LIB_VERSION (F("0.2.0"))
|
||||
#define MINMAX_LIB_VERSION (F("0.2.1"))
|
||||
|
||||
#define MINMAX_NO_CHANGE 0X00
|
||||
#define MINMAX_MIN_CHANGED 0X01
|
||||
|
@ -1,9 +1,13 @@
|
||||
|
||||
|
||||
[![Arduino CI](https://github.com/RobTillaart/MINMAX/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
|
||||
[![Arduino-lint](https://github.com/RobTillaart/MINMAX/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/MINMAX/actions/workflows/arduino-lint.yml)
|
||||
[![JSON check](https://github.com/RobTillaart/MINMAX/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/MINMAX/actions/workflows/jsoncheck.yml)
|
||||
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/MINMAX.svg)](https://github.com/RobTillaart/MINMAX/issues)
|
||||
|
||||
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/MINMAX/blob/master/LICENSE)
|
||||
[![GitHub release](https://img.shields.io/github/release/RobTillaart/MINMAX.svg?maxAge=3600)](https://github.com/RobTillaart/MINMAX/releases)
|
||||
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/MINMAX.svg)](https://registry.platformio.org/libraries/robtillaart/MINMAX)
|
||||
|
||||
|
||||
# MINMAX
|
||||
@ -31,9 +35,13 @@ Finally the library keeps track when the last peaks occurred.
|
||||
|
||||
## Interface
|
||||
|
||||
```cpp
|
||||
#include "MINMAX.h"
|
||||
```
|
||||
|
||||
#### Core
|
||||
|
||||
- **MINMAX** Constructor,
|
||||
- **MINMAX()** Constructor,
|
||||
- **uint8_t add(float value)** add next value. Returns status (bit flags), see table below.
|
||||
- **void reset()** resets the minimum and maximum to 0.
|
||||
- **float minimum()** returns last minimum. Can be higher than previous call due to **reset()** or **autoReset()**.
|
||||
@ -83,7 +91,7 @@ See examples.
|
||||
## Obsolete
|
||||
|
||||
- **void autoReset(uint32_t count)** obsolete since 0.2.0
|
||||
Replaced by **void setAutoResetCount()**
|
||||
Replaced by **void setAutoResetCount(uint32_t count)**
|
||||
|
||||
|
||||
## Operation
|
||||
@ -93,21 +101,26 @@ The examples show the basic working of the functions.
|
||||
|
||||
## Future
|
||||
|
||||
#### must
|
||||
#### Must
|
||||
|
||||
- documentation
|
||||
|
||||
#### Should
|
||||
|
||||
#### should
|
||||
- separate call back for MINMAX_MIN_CHANGED and MINMAX_MAX_CHANGED
|
||||
- add getLastEvent()?
|
||||
- add AVG **average()** **sum()**
|
||||
- like a digital multimeter (DMM)
|
||||
- **sum()** would be sufficient as average can be derived.
|
||||
|
||||
#### could
|
||||
#### Could
|
||||
|
||||
- Template class to allow other types
|
||||
- int32_t uint64_t double etc.
|
||||
- now you loose precision
|
||||
|
||||
#### wont (unless)
|
||||
#### Wont (unless)
|
||||
|
||||
- thresholds, windowing + triggers (separate class?)
|
||||
- auto-reset after time? (would affect all functions ?)
|
||||
- need a uint32_t start;
|
||||
@ -116,4 +129,11 @@ The examples show the basic working of the functions.
|
||||
- should be tested for in every function call.
|
||||
|
||||
|
||||
## Support
|
||||
|
||||
If you appreciate my libraries, you can support the development and maintenance.
|
||||
Improve the quality of the libraries by providing issues and Pull Requests, or
|
||||
donate through PayPal or GitHub sponsors.
|
||||
|
||||
Thank you,
|
||||
|
||||
|
@ -17,6 +17,9 @@ void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("MINMAX_LIB_VERSION: ");
|
||||
Serial.println(MINMAX_LIB_VERSION);
|
||||
Serial.println();
|
||||
|
||||
mm.setAutoResetCount(10000);
|
||||
}
|
||||
|
@ -17,6 +17,9 @@ void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("MINMAX_LIB_VERSION: ");
|
||||
Serial.println(MINMAX_LIB_VERSION);
|
||||
Serial.println();
|
||||
|
||||
mm.setAutoResetCount(10000);
|
||||
mm.addCallBack(display);
|
||||
|
@ -17,6 +17,9 @@ void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("MINMAX_LIB_VERSION: ");
|
||||
Serial.println(MINMAX_LIB_VERSION);
|
||||
Serial.println();
|
||||
|
||||
mm.reset();
|
||||
}
|
||||
|
@ -17,6 +17,9 @@ void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
Serial.println(__FILE__);
|
||||
Serial.print("MINMAX_LIB_VERSION: ");
|
||||
Serial.println(MINMAX_LIB_VERSION);
|
||||
Serial.println();
|
||||
|
||||
mm.setAutoResetCount(10000);
|
||||
}
|
||||
@ -26,7 +29,7 @@ void loop()
|
||||
{
|
||||
int r = random(10001) - 5000;
|
||||
|
||||
if (mm.add(r) != 0x00) // changed minimum or maximum or reset
|
||||
if (mm.add(r) != 0x00) // changed minimum or maximum or reset
|
||||
{
|
||||
Serial.print(mm.count());
|
||||
Serial.print("\t");
|
||||
@ -38,5 +41,5 @@ void loop()
|
||||
}
|
||||
|
||||
|
||||
// -- END OF FILE --
|
||||
// -- END OF FILE --
|
||||
|
||||
|
@ -15,9 +15,9 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/MINMAX.git"
|
||||
},
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"license": "MIT",
|
||||
"frameworks": "arduino",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
"headers": "MINMAX.h"
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=MINMAX
|
||||
version=0.2.0
|
||||
version=0.2.1
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=MINMAX library for Arduino.
|
||||
|
Loading…
x
Reference in New Issue
Block a user