From 2b75e039ea9bcf6fb500904b2558c29d4f09d111 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Sun, 12 Nov 2023 12:00:09 +0100 Subject: [PATCH] update readme.md (#21) - update readme.md - renamed TEMPERATURE_VERSION => TEMPERATURE_LIB_VERSION - updated examples to show LIB version - update keywords.txt - minor edits --- CHANGELOG.md | 11 ++++++++- README.md | 23 +++++++++++++++++-- .../boilingPoint_test/boilingPoint_test.ino | 8 ++----- examples/dewpoint_test/dewpoint_test.ino | 5 +++- .../heatindexC_table/heatindexC_table.ino | 5 ++-- examples/heatindexC_test/heatindexC_test.ino | 5 +++- examples/heatindex_table/heatindex_table.ino | 6 +++-- examples/heatindex_test/heatindex_test.ino | 5 +++- examples/humidex_table/humidex_table.ino | 5 ++-- examples/humidex_test/humidex_test.ino | 5 +++- .../tempConvertor_test/tempConvertor_test.ino | 5 ++-- examples/windChill_test/windChill_test.ino | 5 +++- keywords.txt | 7 +++++- library.json | 4 ++-- library.properties | 2 +- temperature.cpp | 12 +++++----- temperature.h | 5 ++-- test/unit_test_001.cpp | 2 +- 18 files changed, 85 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 694a98e..e31f2ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.3.7] - 2023-11-12 +- update readme.md +- renamed TEMPERATURE_VERSION => TEMPERATURE_LIB_VERSION +- updated examples to show LIB version +- update keywords.txt +- minor edits + + ## [0.3.6] - 2023-02-17 - add **absoluteHumidity(TC, RH)** from relative humidity - add **boilingFahrenheit(feet)** boiling temperature Fahrenheit at height in feet. @@ -18,7 +26,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - update license 2023 - minor edits - ## [0.3.5] - 2022-11-26 - added RP2040 to build-CI - simplified changelog @@ -65,6 +72,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - replaced obsolete links with new ones, - tested and removed some code +---- + ## [0.1.1] - 2017-07-26 - double to float (issue #33) diff --git a/README.md b/README.md index 7e2a5b5..ec72d65 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,11 @@ [![Arduino CI](https://github.com/RobTillaart/Temperature/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci) [![Arduino-lint](https://github.com/RobTillaart/Temperature/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/Temperature/actions/workflows/arduino-lint.yml) [![JSON check](https://github.com/RobTillaart/Temperature/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/Temperature/actions/workflows/jsoncheck.yml) +[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/Temperature.svg)](https://github.com/RobTillaart/Temperature/issues) + [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/Temperature/blob/master/LICENSE) [![GitHub release](https://img.shields.io/github/release/RobTillaart/Temperature.svg?maxAge=3600)](https://github.com/RobTillaart/Temperature/releases) +[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/Temperature.svg)](https://registry.platformio.org/libraries/robtillaart/Temperature) # Temperature @@ -22,6 +25,14 @@ DHT22 or Sensirion, to make a weather station application. Note: pre-0.3.1 versions have incorrect heat-index. +#### Related + +- https://en.wikipedia.org/wiki/Heat_index. +- https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml +- https://wahiduddin.net/calc/density_algorithms.htm +- https://github.com/RobTillaart/pressure + + ## Interface ```cpp @@ -209,11 +220,19 @@ See examples for typical usage. - unit tests - absoluteHumidity - boiling tests. +- add function freezing point shift due to pressure. #### Could -- TEMPERATURE_VERSION => TEMPERATURE_LIB_VERSION - - when split of the converter? 0.4.0 #### 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/examples/boilingPoint_test/boilingPoint_test.ino b/examples/boilingPoint_test/boilingPoint_test.ino index 5b19b05..deb8782 100644 --- a/examples/boilingPoint_test/boilingPoint_test.ino +++ b/examples/boilingPoint_test/boilingPoint_test.ino @@ -15,8 +15,8 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); - Serial.print("TEMPERATURE_VERSION: "); - Serial.println(TEMPERATURE_VERSION); + Serial.print("TEMPERATURE_LIB_VERSION: "); + Serial.println(TEMPERATURE_LIB_VERSION); Serial.println(); for (int meters = 0; meters < 5000; meters += 100) @@ -30,7 +30,6 @@ void setup() } Serial.println(); - for (int feet = 0; feet <= 15000; feet += 100) { Serial.print(feet); @@ -42,7 +41,6 @@ void setup() } Serial.println(); - for (float temp = 100; temp >= 80; temp -= 1) { Serial.print(temp); @@ -60,13 +58,11 @@ void setup() Serial.print("\n"); } Serial.println(); - } void loop() { - } diff --git a/examples/dewpoint_test/dewpoint_test.ino b/examples/dewpoint_test/dewpoint_test.ino index bacd927..f6f99af 100644 --- a/examples/dewpoint_test/dewpoint_test.ino +++ b/examples/dewpoint_test/dewpoint_test.ino @@ -20,6 +20,9 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); + Serial.print("TEMPERATURE_LIB_VERSION: "); + Serial.println(TEMPERATURE_LIB_VERSION); + Serial.println(); Serial.println("takes ~40 seconds"); Serial.println(dewPoint(25, 50), 2); @@ -74,5 +77,5 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/heatindexC_table/heatindexC_table.ino b/examples/heatindexC_table/heatindexC_table.ino index 063ecd9..3d3761b 100644 --- a/examples/heatindexC_table/heatindexC_table.ino +++ b/examples/heatindexC_table/heatindexC_table.ino @@ -15,7 +15,8 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); - + Serial.print("TEMPERATURE_LIB_VERSION: "); + Serial.println(TEMPERATURE_LIB_VERSION); Serial.println(); for (int t = 25; t <= 45; t += 1) @@ -49,4 +50,4 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/heatindexC_test/heatindexC_test.ino b/examples/heatindexC_test/heatindexC_test.ino index e14717a..2559cb0 100644 --- a/examples/heatindexC_test/heatindexC_test.ino +++ b/examples/heatindexC_test/heatindexC_test.ino @@ -18,6 +18,9 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); + Serial.print("TEMPERATURE_LIB_VERSION: "); + Serial.println(TEMPERATURE_LIB_VERSION); + Serial.println(); Serial.println(heatIndexC(25, 50), 2); @@ -44,4 +47,4 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/heatindex_table/heatindex_table.ino b/examples/heatindex_table/heatindex_table.ino index 84da848..14b44ed 100644 --- a/examples/heatindex_table/heatindex_table.ino +++ b/examples/heatindex_table/heatindex_table.ino @@ -15,8 +15,10 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); - + Serial.print("TEMPERATURE_LIB_VERSION: "); + Serial.println(TEMPERATURE_LIB_VERSION); Serial.println(); + Serial.println(" Compare to: https://www.calculator.net/heat-index-calculator.html\n"); Serial.println(); @@ -67,4 +69,4 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/heatindex_test/heatindex_test.ino b/examples/heatindex_test/heatindex_test.ino index 9b29df9..629a652 100644 --- a/examples/heatindex_test/heatindex_test.ino +++ b/examples/heatindex_test/heatindex_test.ino @@ -17,6 +17,9 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); + Serial.print("TEMPERATURE_LIB_VERSION: "); + Serial.println(TEMPERATURE_LIB_VERSION); + Serial.println(); Serial.println(heatIndex(100, 50), 2); @@ -40,5 +43,5 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/humidex_table/humidex_table.ino b/examples/humidex_table/humidex_table.ino index 5a0c1e5..9437a0b 100644 --- a/examples/humidex_table/humidex_table.ino +++ b/examples/humidex_table/humidex_table.ino @@ -12,7 +12,8 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); - + Serial.print("TEMPERATURE_LIB_VERSION: "); + Serial.println(TEMPERATURE_LIB_VERSION); Serial.println(); for (int cel = 20; cel < 45; cel++) @@ -47,5 +48,5 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/humidex_test/humidex_test.ino b/examples/humidex_test/humidex_test.ino index f54f2c3..e1fd03f 100644 --- a/examples/humidex_test/humidex_test.ino +++ b/examples/humidex_test/humidex_test.ino @@ -18,6 +18,9 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); + Serial.print("TEMPERATURE_LIB_VERSION: "); + Serial.println(TEMPERATURE_LIB_VERSION); + Serial.println(); Serial.println(humidex(25, 50), 2); @@ -42,5 +45,5 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/tempConvertor_test/tempConvertor_test.ino b/examples/tempConvertor_test/tempConvertor_test.ino index 89c2962..c7fe85e 100644 --- a/examples/tempConvertor_test/tempConvertor_test.ino +++ b/examples/tempConvertor_test/tempConvertor_test.ino @@ -14,7 +14,8 @@ void setup() Serial.begin(115200); while(!Serial); Serial.println(__FILE__); - + Serial.print("TEMPERATURE_LIB_VERSION: "); + Serial.println(TEMPERATURE_LIB_VERSION); Serial.println(); for (int celsius = -20; celsius <= 125; celsius++) @@ -103,4 +104,4 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/windChill_test/windChill_test.ino b/examples/windChill_test/windChill_test.ino index c602def..1ab14aa 100644 --- a/examples/windChill_test/windChill_test.ino +++ b/examples/windChill_test/windChill_test.ino @@ -11,6 +11,9 @@ void setup() { Serial.begin(115200); Serial.println(__FILE__); + Serial.print("TEMPERATURE_LIB_VERSION: "); + Serial.println(TEMPERATURE_LIB_VERSION); + Serial.println(); Serial.println(WindChill_F_mph (0, 10, true), 3); Serial.println(WindChill_C_kmph(0, 10, true), 3); @@ -32,4 +35,4 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/keywords.txt b/keywords.txt index 6c1828c..036be0f 100644 --- a/keywords.txt +++ b/keywords.txt @@ -17,11 +17,15 @@ humidex KEYWORD2 heatIndex KEYWORD2 heatIndexC KEYWORD2 +absoluteHumidity KEYWORD2 + WindChill_F_mph KEYWORD2 WindChill_C_kmph KEYWORD2 WindChill_C_mps KEYWORD2 -absoluteHumidity KEYWORD2 +baroToSeaLevelC KEYWORD2 +seaLevelToAltitude KEYWORD2 +altitudeToSeaLevel KEYWORD2 boilingFahrenheit KEYWORD2 boilingCelsius KEYWORD2 @@ -50,4 +54,5 @@ getRomer KEYWORD2 # Constants (LITERAL1) +TEMPERATURE_LIB_VERSION LITERAL1 diff --git a/library.json b/library.json index 8631784..2c322c3 100644 --- a/library.json +++ b/library.json @@ -15,9 +15,9 @@ "type": "git", "url": "https://github.com/RobTillaart/Temperature" }, - "version": "0.3.6", + "version": "0.3.7", "license": "MIT", - "frameworks": "arduino", + "frameworks": "*", "platforms": "*", "headers": "temperature.h" } diff --git a/library.properties b/library.properties index 0e770cb..c9a294b 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Temperature -version=0.3.6 +version=0.3.7 author=Rob Tillaart maintainer=Rob Tillaart sentence=Library with weather and temperature conversion functions. diff --git a/temperature.cpp b/temperature.cpp index abdf1c2..7b47a77 100644 --- a/temperature.cpp +++ b/temperature.cpp @@ -1,7 +1,7 @@ // // FILE: temperature.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.3.6 +// VERSION: 0.3.7 // DATE: 2015-03-29 // PURPOSE: collection temperature functions // URL: https://github.com/RobTillaart/Temperature @@ -37,12 +37,12 @@ float dewPoint(float celsius, float humidity) { // Calculate saturation vapour pressure // ratio 100C and actual temp in Kelvin - float A0 = 373.15 / (273.15 + celsius); + float AA0 = 373.15 / (273.15 + celsius); // SVP = Saturation Vapor Pressure - based on ESGG() NOAA - float SVP = -7.90298 * (A0 - 1.0); - SVP += 5.02808 * log10(A0); - SVP += -1.3816e-7 * (pow(10, (11.344 * ( 1.0 - 1.0/A0))) - 1.0 ); - SVP += 8.1328e-3 * (pow(10, (-3.49149 * (A0 - 1.0 ))) - 1.0 ) ; + float SVP = -7.90298 * (AA0 - 1.0); + SVP += 5.02808 * log10(AA0); + SVP += -1.3816e-7 * (pow(10, (11.344 * ( 1.0 - 1.0/AA0))) - 1.0 ); + SVP += 8.1328e-3 * (pow(10, (-3.49149 * (AA0 - 1.0 ))) - 1.0 ) ; SVP += log10(1013.246); // calculate actual vapour pressure VP; diff --git a/temperature.h b/temperature.h index 267331a..f7d1b67 100644 --- a/temperature.h +++ b/temperature.h @@ -2,7 +2,7 @@ // // FILE: temperature.h // AUTHOR: Rob Tillaart -// VERSION: 0.3.6 +// VERSION: 0.3.7 // DATE: 2015-03-29 // PURPOSE: collection temperature functions // URL: https://github.com/RobTillaart/Temperature @@ -11,7 +11,8 @@ #include "Arduino.h" -#define TEMPERATURE_VERSION (F("0.3.6")) +#define TEMPERATURE_LIB_VERSION (F("0.3.7")) +#define TEMPERATURE_VERSION (F("0.3.7")) // obsolete in 0.4.0 float Fahrenheit(float celsius); diff --git a/test/unit_test_001.cpp b/test/unit_test_001.cpp index 1d0a15a..48f43ca 100644 --- a/test/unit_test_001.cpp +++ b/test/unit_test_001.cpp @@ -40,7 +40,7 @@ unittest_setup() { - fprintf(stderr, "TEMPERATURE_VERSION: %s\n", (char *) TEMPERATURE_VERSION); + fprintf(stderr, "TEMPERATURE_LIB_VERSION: %s\n", (char *) TEMPERATURE_LIB_VERSION); }