0.2.1 MINMAX

This commit is contained in:
Rob Tillaart 2023-11-14 11:47:18 +01:00
parent 6d788ddcfd
commit 725b6fff88
10 changed files with 51 additions and 15 deletions

View File

@ -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/). 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 ## [0.2.0] - 2022-12-07
- fix #6 split in .cpp and .h - fix #6 split in .cpp and .h
- remove obsolete autoReset() - remove obsolete autoReset()
@ -14,7 +19,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- update unit test - update unit test
- update examples - update examples
---- ----
## [0.1.3] - 2022-11-17 ## [0.1.3] - 2022-11-17

View File

@ -1,7 +1,7 @@
// //
// FILE: MINMAX.cpp // FILE: MINMAX.cpp
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.2.0 // VERSION: 0.2.1
// DATE: 2021-10-14 // DATE: 2021-10-14
// PURPOSE: MINMAX library - simple peak finder // PURPOSE: MINMAX library - simple peak finder
// URL: https://github.com/RobTillaart/MINMAX // URL: https://github.com/RobTillaart/MINMAX

View File

@ -2,7 +2,7 @@
// //
// FILE: MINMAX.h // FILE: MINMAX.h
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.2.0 // VERSION: 0.2.1
// DATE: 2021-10-14 // DATE: 2021-10-14
// PURPOSE: MINMAX library - simple peak finder // PURPOSE: MINMAX library - simple peak finder
// URL: https://github.com/RobTillaart/MINMAX // URL: https://github.com/RobTillaart/MINMAX
@ -10,7 +10,7 @@
#include "Arduino.h" #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_NO_CHANGE 0X00
#define MINMAX_MIN_CHANGED 0X01 #define MINMAX_MIN_CHANGED 0X01

View File

@ -1,9 +1,13 @@
[![Arduino CI](https://github.com/RobTillaart/MINMAX/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) [![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) [![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) [![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) [![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) [![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 # MINMAX
@ -31,9 +35,13 @@ Finally the library keeps track when the last peaks occurred.
## Interface ## Interface
```cpp
#include "MINMAX.h"
```
#### Core #### Core
- **MINMAX** Constructor, - **MINMAX()** Constructor,
- **uint8_t add(float value)** add next value. Returns status (bit flags), see table below. - **uint8_t add(float value)** add next value. Returns status (bit flags), see table below.
- **void reset()** resets the minimum and maximum to 0. - **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()**. - **float minimum()** returns last minimum. Can be higher than previous call due to **reset()** or **autoReset()**.
@ -83,7 +91,7 @@ See examples.
## Obsolete ## Obsolete
- **void autoReset(uint32_t count)** obsolete since 0.2.0 - **void autoReset(uint32_t count)** obsolete since 0.2.0
Replaced by **void setAutoResetCount()** Replaced by **void setAutoResetCount(uint32_t count)**
## Operation ## Operation
@ -93,21 +101,26 @@ The examples show the basic working of the functions.
## Future ## Future
#### must #### Must
- documentation
#### Should
#### should
- separate call back for MINMAX_MIN_CHANGED and MINMAX_MAX_CHANGED - separate call back for MINMAX_MIN_CHANGED and MINMAX_MAX_CHANGED
- add getLastEvent()? - add getLastEvent()?
- add AVG **average()** **sum()** - add AVG **average()** **sum()**
- like a digital multimeter (DMM) - like a digital multimeter (DMM)
- **sum()** would be sufficient as average can be derived. - **sum()** would be sufficient as average can be derived.
#### could #### Could
- Template class to allow other types - Template class to allow other types
- int32_t uint64_t double etc. - int32_t uint64_t double etc.
- now you loose precision - now you loose precision
#### wont (unless) #### Wont (unless)
- thresholds, windowing + triggers (separate class?) - thresholds, windowing + triggers (separate class?)
- auto-reset after time? (would affect all functions ?) - auto-reset after time? (would affect all functions ?)
- need a uint32_t start; - 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. - 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,

View File

@ -17,6 +17,9 @@ void setup()
{ {
Serial.begin(115200); Serial.begin(115200);
Serial.println(__FILE__); Serial.println(__FILE__);
Serial.print("MINMAX_LIB_VERSION: ");
Serial.println(MINMAX_LIB_VERSION);
Serial.println();
mm.setAutoResetCount(10000); mm.setAutoResetCount(10000);
} }

View File

@ -17,6 +17,9 @@ void setup()
{ {
Serial.begin(115200); Serial.begin(115200);
Serial.println(__FILE__); Serial.println(__FILE__);
Serial.print("MINMAX_LIB_VERSION: ");
Serial.println(MINMAX_LIB_VERSION);
Serial.println();
mm.setAutoResetCount(10000); mm.setAutoResetCount(10000);
mm.addCallBack(display); mm.addCallBack(display);

View File

@ -17,6 +17,9 @@ void setup()
{ {
Serial.begin(115200); Serial.begin(115200);
Serial.println(__FILE__); Serial.println(__FILE__);
Serial.print("MINMAX_LIB_VERSION: ");
Serial.println(MINMAX_LIB_VERSION);
Serial.println();
mm.reset(); mm.reset();
} }

View File

@ -17,6 +17,9 @@ void setup()
{ {
Serial.begin(115200); Serial.begin(115200);
Serial.println(__FILE__); Serial.println(__FILE__);
Serial.print("MINMAX_LIB_VERSION: ");
Serial.println(MINMAX_LIB_VERSION);
Serial.println();
mm.setAutoResetCount(10000); mm.setAutoResetCount(10000);
} }

View File

@ -15,9 +15,9 @@
"type": "git", "type": "git",
"url": "https://github.com/RobTillaart/MINMAX.git" "url": "https://github.com/RobTillaart/MINMAX.git"
}, },
"version": "0.2.0", "version": "0.2.1",
"license": "MIT", "license": "MIT",
"frameworks": "arduino", "frameworks": "*",
"platforms": "*", "platforms": "*",
"headers": "MINMAX.h" "headers": "MINMAX.h"
} }

View File

@ -1,5 +1,5 @@
name=MINMAX name=MINMAX
version=0.2.0 version=0.2.1
author=Rob Tillaart <rob.tillaart@gmail.com> author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com> maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=MINMAX library for Arduino. sentence=MINMAX library for Arduino.