From b8b7012b5ea9dc3c072763d639b21b883e4eafc5 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Tue, 7 Nov 2023 15:01:17 +0100 Subject: [PATCH] 0.1.4 Interval --- libraries/Interval/CHANGELOG.md | 10 ++++++--- libraries/Interval/Interval.cpp | 14 ++++++------- libraries/Interval/Interval.h | 17 +++++++-------- libraries/Interval/README.md | 30 +++++++++++++++++++++++++-- libraries/Interval/library.json | 4 ++-- libraries/Interval/library.properties | 4 ++-- 6 files changed, 52 insertions(+), 27 deletions(-) diff --git a/libraries/Interval/CHANGELOG.md b/libraries/Interval/CHANGELOG.md index 6a91c170..8b6b72e1 100644 --- a/libraries/Interval/CHANGELOG.md +++ b/libraries/Interval/CHANGELOG.md @@ -6,11 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.1.4] - 2023-11-07 +- update readme.md +- minor edits + + ## [0.1.3] - 2022-11-14 - Add RP2040 support to build-CI. - Add CHANGELOG.md - ## [0.1.2] - 2021-12-20 - update library.json - update license @@ -19,13 +23,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.1.1] - 2021-05-27 - add Arduino-lint ----- - ## [0.1.0] - 2020-12-30 - Arduino-CI - unit tests - setRange() +---- + ## [0.0.1] - 2020-07-20 - initial version (not complete) diff --git a/libraries/Interval/Interval.cpp b/libraries/Interval/Interval.cpp index 67a8fbba..bf5f6705 100644 --- a/libraries/Interval/Interval.cpp +++ b/libraries/Interval/Interval.cpp @@ -2,11 +2,9 @@ // FILE: Interval.cpp // AUTHOR: Rob Tillaart // DATE: 2020-07-21 -// VERSION: 0.1.3 +// VERSION: 0.1.4 // PURPOSE: Arduino library for Interval data type // URL: https://github.com/RobTillaart/Interval -// -// HISTORY: see changelog.md #include "Interval.h" @@ -18,7 +16,7 @@ Interval::Interval(float lo, float hi) { _lo = lo; _hi = hi; - } + } else { _lo = hi; @@ -150,22 +148,22 @@ bool Interval::operator != (const Interval &in) // { // return this->value() > in.value(); // } -// +// // bool Interval::operator >= (const Interval &in) // { // return this->value() >= in.value(); // } -// +// // bool Interval::operator < (const Interval &in) // { // return this->value() < in.value(); // } -// +// // bool Interval::operator <= (const Interval &in) // { // return this->value() <= in.value(); // } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/libraries/Interval/Interval.h b/libraries/Interval/Interval.h index 93bd4746..f2aef073 100644 --- a/libraries/Interval/Interval.h +++ b/libraries/Interval/Interval.h @@ -3,17 +3,14 @@ // FILE: Interval.h // AUTHOR: Rob Tillaart // DATE: 2020-07-21 -// VERSION: 0.1.3 +// VERSION: 0.1.4 // PURPOSE: Arduino library for Interval datatype // URL: https://github.com/RobTillaart/Interval -// -// HISTORY: -// see Interval.cpp file #include "Arduino.h" -#define INTERVAL_LIB_VERSION (F("0.1.3")) +#define INTERVAL_LIB_VERSION (F("0.1.4")) class Interval: public Printable @@ -22,14 +19,14 @@ public: // CONSTRUCTOR Interval(); Interval(float lo, float hi); - Interval(float f); // default zero interval [f, f] + Interval(float f); // default zero interval [f, f] // PRINTABLE size_t printTo(Print& p) const; void setDecimals(uint8_t n) { _decimals = n; }; // BASE FUNCTIONS - float value() { return (_hi /2 + _lo /2); }; // assumption + float value() { return (_hi /2 + _lo /2); }; // assumption / estimation float range() { return _hi -_lo; }; float high() { return _hi; }; float low() { return _lo; }; @@ -56,8 +53,8 @@ public: // SET OPERATORS - // Interval operator & (const Interval&); // common part [1, 5] & [4, 8] => [4, 5] - // Interval operator | (const Interval&); // superset [1, 5] | [4, 8] => [1, 8] + // Interval operator & (const Interval&); // common part [1, 5] & [4, 8] => [4, 5] + // Interval operator | (const Interval&); // superset [1, 5] | [4, 8] => [1, 8] // Interval operator ^ (const Interval&); // // smaller @@ -68,5 +65,5 @@ private: }; -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/libraries/Interval/README.md b/libraries/Interval/README.md index bab0643d..a49d471f 100644 --- a/libraries/Interval/README.md +++ b/libraries/Interval/README.md @@ -2,8 +2,11 @@ [![Arduino CI](https://github.com/RobTillaart/Interval/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) [![Arduino-lint](https://github.com/RobTillaart/Interval/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/Interval/actions/workflows/arduino-lint.yml) [![JSON check](https://github.com/RobTillaart/Interval/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/Interval/actions/workflows/jsoncheck.yml) +[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/Interval.svg)](https://github.com/RobTillaart/Interval/issues) + [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/Interval/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/RobTillaart/Interval.svg?maxAge=3600)](https://github.com/RobTillaart/Interval/releases) +[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/Interval.svg)](https://registry.platformio.org/libraries/robtillaart/Interval) # Interval @@ -13,7 +16,7 @@ Arduino library for the Interval data type. **Experimental** ## Description -This experimental library provides basic math when you do not know a quantity. +This **experimental** library provides basic math when you do not know a quantity. The only thing you do know is the value is in a certain interval. After doing some math you want to know the interval of possible outcomes. @@ -27,6 +30,10 @@ Frink itself is not investigated, so semantics are not necessary similar. ## Interface +```cpp +#include "Interval.h" +``` + The Interval class implements the public interface of Printable. This allows you to print an Interval in human readable form. @@ -134,7 +141,26 @@ See example ## Future +#### Must + +- improve documentation + - clean up + +#### Should + - play and extend the library. - check all to be investigated above. -- clean up the documentation. + +#### Could + +#### Wont + + +## 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/Interval/library.json b/libraries/Interval/library.json index 9d8fd8d4..2a493a35 100644 --- a/libraries/Interval/library.json +++ b/libraries/Interval/library.json @@ -1,7 +1,7 @@ { "name": "Interval", "keywords": "Interval, range, value", - "description": "Arduino library for Interval datatype", + "description": "Arduino library for Interval data type", "authors": [ { @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/Interval" }, - "version": "0.1.3", + "version": "0.1.4", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/libraries/Interval/library.properties b/libraries/Interval/library.properties index 0bca626f..501b63bb 100644 --- a/libraries/Interval/library.properties +++ b/libraries/Interval/library.properties @@ -1,8 +1,8 @@ name=Interval -version=0.1.3 +version=0.1.4 author=Rob Tillaart maintainer=Rob Tillaart -sentence=Arduino library for Interval datatype +sentence=Arduino library for Interval data type. paragraph= category=Data Processing url=https://github.com/RobTillaart/Interval.git