Skip to content

Commit

Permalink
update readme.md (#21)
Browse files Browse the repository at this point in the history
- update readme.md
- renamed TEMPERATURE_VERSION => TEMPERATURE_LIB_VERSION
- updated examples to show LIB version
- update keywords.txt
- minor edits
  • Loading branch information
RobTillaart committed Nov 12, 2023
1 parent 89155e6 commit 2b75e03
Show file tree
Hide file tree
Showing 18 changed files with 85 additions and 35 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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)

Expand Down
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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,

8 changes: 2 additions & 6 deletions examples/boilingPoint_test/boilingPoint_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -30,7 +30,6 @@ void setup()
}
Serial.println();


for (int feet = 0; feet <= 15000; feet += 100)
{
Serial.print(feet);
Expand All @@ -42,7 +41,6 @@ void setup()
}
Serial.println();


for (float temp = 100; temp >= 80; temp -= 1)
{
Serial.print(temp);
Expand All @@ -60,13 +58,11 @@ void setup()
Serial.print("\n");
}
Serial.println();

}


void loop()
{

}


Expand Down
5 changes: 4 additions & 1 deletion examples/dewpoint_test/dewpoint_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -74,5 +77,5 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --

5 changes: 3 additions & 2 deletions examples/heatindexC_table/heatindexC_table.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -49,4 +50,4 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --
5 changes: 4 additions & 1 deletion examples/heatindexC_test/heatindexC_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -44,4 +47,4 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --
6 changes: 4 additions & 2 deletions examples/heatindex_table/heatindex_table.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -67,4 +69,4 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --
5 changes: 4 additions & 1 deletion examples/heatindex_test/heatindex_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -40,5 +43,5 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --

5 changes: 3 additions & 2 deletions examples/humidex_table/humidex_table.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down Expand Up @@ -47,5 +48,5 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --

5 changes: 4 additions & 1 deletion examples/humidex_test/humidex_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -42,5 +45,5 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --

5 changes: 3 additions & 2 deletions examples/tempConvertor_test/tempConvertor_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down Expand Up @@ -103,4 +104,4 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --
5 changes: 4 additions & 1 deletion examples/windChill_test/windChill_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -32,4 +35,4 @@ void loop()
}


// -- END OF FILE --
// -- END OF FILE --
7 changes: 6 additions & 1 deletion keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -50,4 +54,5 @@ getRomer KEYWORD2


# Constants (LITERAL1)
TEMPERATURE_LIB_VERSION LITERAL1

4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
12 changes: 6 additions & 6 deletions temperature.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions temperature.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/unit_test_001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down

0 comments on commit 2b75e03

Please sign in to comment.