From 725b6fff88ff36dc80cb7a996e783adc3b00f097 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Tue, 14 Nov 2023 11:47:18 +0100 Subject: [PATCH] 0.2.1 MINMAX --- libraries/MINMAX/CHANGELOG.md | 6 +++- libraries/MINMAX/MINMAX.cpp | 2 +- libraries/MINMAX/MINMAX.h | 4 +-- libraries/MINMAX/README.md | 32 +++++++++++++++---- .../minmax_autoreset/minmax_autoreset.ino | 3 ++ .../minmax_callback/minmax_callback.ino | 3 ++ .../examples/minmax_demo/minmax_demo.ino | 3 ++ .../MINMAX/examples/minmax_new/minmax_new.ino | 7 ++-- libraries/MINMAX/library.json | 4 +-- libraries/MINMAX/library.properties | 2 +- 10 files changed, 51 insertions(+), 15 deletions(-) diff --git a/libraries/MINMAX/CHANGELOG.md b/libraries/MINMAX/CHANGELOG.md index 617cb9fc..b8fbcdd6 100644 --- a/libraries/MINMAX/CHANGELOG.md +++ b/libraries/MINMAX/CHANGELOG.md @@ -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 diff --git a/libraries/MINMAX/MINMAX.cpp b/libraries/MINMAX/MINMAX.cpp index 94a89c84..52beca01 100644 --- a/libraries/MINMAX/MINMAX.cpp +++ b/libraries/MINMAX/MINMAX.cpp @@ -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 diff --git a/libraries/MINMAX/MINMAX.h b/libraries/MINMAX/MINMAX.h index aa7fcf46..2d105e0e 100644 --- a/libraries/MINMAX/MINMAX.h +++ b/libraries/MINMAX/MINMAX.h @@ -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 diff --git a/libraries/MINMAX/README.md b/libraries/MINMAX/README.md index 700f185a..a3aeda73 100644 --- a/libraries/MINMAX/README.md +++ b/libraries/MINMAX/README.md @@ -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, diff --git a/libraries/MINMAX/examples/minmax_autoreset/minmax_autoreset.ino b/libraries/MINMAX/examples/minmax_autoreset/minmax_autoreset.ino index fea397c2..4b434aca 100644 --- a/libraries/MINMAX/examples/minmax_autoreset/minmax_autoreset.ino +++ b/libraries/MINMAX/examples/minmax_autoreset/minmax_autoreset.ino @@ -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); } diff --git a/libraries/MINMAX/examples/minmax_callback/minmax_callback.ino b/libraries/MINMAX/examples/minmax_callback/minmax_callback.ino index 228636c2..dffd2a4b 100644 --- a/libraries/MINMAX/examples/minmax_callback/minmax_callback.ino +++ b/libraries/MINMAX/examples/minmax_callback/minmax_callback.ino @@ -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); diff --git a/libraries/MINMAX/examples/minmax_demo/minmax_demo.ino b/libraries/MINMAX/examples/minmax_demo/minmax_demo.ino index fc8d4c16..42dda3fc 100644 --- a/libraries/MINMAX/examples/minmax_demo/minmax_demo.ino +++ b/libraries/MINMAX/examples/minmax_demo/minmax_demo.ino @@ -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(); } diff --git a/libraries/MINMAX/examples/minmax_new/minmax_new.ino b/libraries/MINMAX/examples/minmax_new/minmax_new.ino index 79093f55..294b9c48 100644 --- a/libraries/MINMAX/examples/minmax_new/minmax_new.ino +++ b/libraries/MINMAX/examples/minmax_new/minmax_new.ino @@ -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 -- diff --git a/libraries/MINMAX/library.json b/libraries/MINMAX/library.json index e4dca765..187c5179 100644 --- a/libraries/MINMAX/library.json +++ b/libraries/MINMAX/library.json @@ -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" } diff --git a/libraries/MINMAX/library.properties b/libraries/MINMAX/library.properties index 95ce5d0e..e3cec45a 100644 --- a/libraries/MINMAX/library.properties +++ b/libraries/MINMAX/library.properties @@ -1,5 +1,5 @@ name=MINMAX -version=0.2.0 +version=0.2.1 author=Rob Tillaart maintainer=Rob Tillaart sentence=MINMAX library for Arduino.