0.3.7 Temperature

This commit is contained in:
Rob Tillaart 2023-11-12 12:14:21 +01:00
parent bcc2388a99
commit 2a20a25190
18 changed files with 85 additions and 35 deletions

View File

@ -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)

View File

@ -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()
{
}

View File

@ -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 --

View File

@ -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 --

View File

@ -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 --

View File

@ -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 --

View File

@ -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 --

View File

@ -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 --

View File

@ -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 --

View File

@ -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 --

View File

@ -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 --

View File

@ -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

View File

@ -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"
}

View File

@ -1,5 +1,5 @@
name=Temperature
version=0.3.6
version=0.3.7
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Library with weather and temperature conversion functions.

View File

@ -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,

View File

@ -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;

View File

@ -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);

View File

@ -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);
}