From e44d126aebbf53ae9378f3c95831b7e1f8d5ce39 Mon Sep 17 00:00:00 2001 From: Rob Tillaart Date: Fri, 5 Jan 2024 15:25:34 +0100 Subject: [PATCH] Fix URL in examples + minor edits (#29) --- CHANGELOG.md | 6 +++++- LICENSE | 2 +- RunningAverage.cpp | 2 +- RunningAverage.h | 7 +++++-- examples/fillValue/fillValue.ino | 4 +++- examples/ra_300/ra_300.ino | 4 +++- examples/ra_300_last/ra_300_last.ino | 4 +++- examples/ra_FastAverageTest/ra_FastAverageTest.ino | 12 ++++++++---- examples/ra_MinMaxBufferTest/ra_MinMaxBufferTest.ino | 4 +++- examples/ra_MinMaxTest/ra_MinMaxTest.ino | 4 +++- examples/ra_fillValue_test/ra_fillValue_test.ino | 4 +++- examples/ra_getAverageSubset/ra_getAverageSubset.ino | 4 +++- examples/ra_getValue/ra_getValue.ino | 4 +++- examples/ra_hour/ra_hour.ino | 4 +++- examples/ra_partial/ra_partial.ino | 4 +++- examples/ra_performance/ra_performance.ino | 4 +++- examples/ra_test/ra_test.ino | 4 +++- examples/ra_two_sensors/ra_two_sensors.ino | 4 +++- examples/ra_two_step/ra_two_step.ino | 4 +++- library.json | 2 +- library.properties | 2 +- 21 files changed, 64 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 153eeda..8dab254 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,13 +6,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.4.5] - 2024-01-05 +- fix URL in examples +- minor edits + + ## [0.4.4] - 2023-10-18 - update readme.md badges - update examples - add two step example - minor edits - ## [0.4.3] - 2022-11-23 - add changelog.md - add RP2040 to build-CI diff --git a/LICENSE b/LICENSE index 5a1dd63..48868ba 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2012-2023 Rob Tillaart +Copyright (c) 2012-2024 Rob Tillaart Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/RunningAverage.cpp b/RunningAverage.cpp index f74a912..268dde4 100644 --- a/RunningAverage.cpp +++ b/RunningAverage.cpp @@ -1,7 +1,7 @@ // // FILE: RunningAverage.cpp // AUTHOR: Rob Tillaart -// VERSION: 0.4.4 +// VERSION: 0.4.5 // DATE: 2011-01-30 // PURPOSE: Arduino library to calculate the running average by means of a circular buffer // URL: https://github.com/RobTillaart/RunningAverage diff --git a/RunningAverage.h b/RunningAverage.h index a510b68..94585de 100644 --- a/RunningAverage.h +++ b/RunningAverage.h @@ -2,16 +2,19 @@ // // FILE: RunningAverage.h // AUTHOR: Rob Tillaart -// VERSION: 0.4.4 +// VERSION: 0.4.5 // DATE: 2011-01-30 // PURPOSE: Arduino library to calculate the running average by means of a circular buffer // URL: https://github.com/RobTillaart/RunningAverage +// +// The library stores N individual values in a circular buffer, +// to calculate the running average. #include "Arduino.h" -#define RUNNINGAVERAGE_LIB_VERSION (F("0.4.4")) +#define RUNNINGAVERAGE_LIB_VERSION (F("0.4.5")) class RunningAverage diff --git a/examples/fillValue/fillValue.ino b/examples/fillValue/fillValue.ino index 0624b0a..2f26348 100644 --- a/examples/fillValue/fillValue.ino +++ b/examples/fillValue/fillValue.ino @@ -2,11 +2,13 @@ // FILE: fillValue.ino // AUTHOR: Rob Tillaart // DATE: 2012-12-30 -// PUPROSE: demo + timing of fillValue +// PURPOSE: demo + timing of fillValue +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage myRA(10); int samples = 0; diff --git a/examples/ra_300/ra_300.ino b/examples/ra_300/ra_300.ino index ae679df..19b2d34 100644 --- a/examples/ra_300/ra_300.ino +++ b/examples/ra_300/ra_300.ino @@ -2,11 +2,13 @@ // FILE: ra_300.ino // AUTHOR: Rob Tillaart // DATE: 2021-05-26 -// PUPROSE: demonstrate large (16 bit) buffer +// PURPOSE: demonstrate large (16 bit) buffer +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage myRA(300); int samples = 0; diff --git a/examples/ra_300_last/ra_300_last.ino b/examples/ra_300_last/ra_300_last.ino index 813270a..8167168 100644 --- a/examples/ra_300_last/ra_300_last.ino +++ b/examples/ra_300_last/ra_300_last.ino @@ -2,11 +2,13 @@ // FILE: ra_300.ino // AUTHOR: Rob Tillaart // DATE: 2021-05-26 -// PUPROSE: demonstrate large (16 bit) buffer +// PURPOSE: demonstrate large (16 bit) buffer +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage myRA(300); int samples = 0; diff --git a/examples/ra_FastAverageTest/ra_FastAverageTest.ino b/examples/ra_FastAverageTest/ra_FastAverageTest.ino index f98f866..2a6b6cd 100644 --- a/examples/ra_FastAverageTest/ra_FastAverageTest.ino +++ b/examples/ra_FastAverageTest/ra_FastAverageTest.ino @@ -2,11 +2,13 @@ // FILE: ra_FastAverageTest.ino // AUTHOR: Rob Tillaart // DATE: 2015-sep-04 -// PUPROSE: demo to see if different average algorithm give different result +// PURPOSE: demo to see if different average algorithm give different result +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage myRA(16); float avg = 0; @@ -24,7 +26,9 @@ void setup(void) Serial.println(__FILE__); Serial.print("RUNNINGAVERAGE_LIB_VERSION: "); Serial.println(RUNNINGAVERAGE_LIB_VERSION); - myRA.clear(); // explicitly start clean + + // explicitly start clean + myRA.clear(); measure_duration(); } @@ -67,8 +71,8 @@ void test(long n) myRA.addValue(rn * 0.001); if ( i % 1000 == 0) { - // the order of the next two lines is important as getAverage() resets the _sum - // used by the getFastAverage(); + // the order of the next two lines is important as getAverage() resets the _sum + // used by the getFastAverage(); favg = myRA.getFastAverage(); avg = myRA.getAverage(); diff = abs(avg - favg); diff --git a/examples/ra_MinMaxBufferTest/ra_MinMaxBufferTest.ino b/examples/ra_MinMaxBufferTest/ra_MinMaxBufferTest.ino index de0ae2b..b86593a 100644 --- a/examples/ra_MinMaxBufferTest/ra_MinMaxBufferTest.ino +++ b/examples/ra_MinMaxBufferTest/ra_MinMaxBufferTest.ino @@ -2,11 +2,13 @@ // FILE: ra_MinMaxBufferTest.ino // AUTHOR: Rob Tillaart // DATE: 2015-09-04 -// PUPROSE: demo +// PURPOSE: demo +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage myRA(10); int samples = 0; diff --git a/examples/ra_MinMaxTest/ra_MinMaxTest.ino b/examples/ra_MinMaxTest/ra_MinMaxTest.ino index 9c12fc4..6418679 100644 --- a/examples/ra_MinMaxTest/ra_MinMaxTest.ino +++ b/examples/ra_MinMaxTest/ra_MinMaxTest.ino @@ -2,11 +2,13 @@ // FILE: runningAverageMinMaxTest.ino // AUTHOR: Rob Tillaart // DATE: 2015-apr-10 -// PUPROSE: demo +// PURPOSE: demo +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage myRA(10); int samples = 0; diff --git a/examples/ra_fillValue_test/ra_fillValue_test.ino b/examples/ra_fillValue_test/ra_fillValue_test.ino index 66a4997..1c198a9 100644 --- a/examples/ra_fillValue_test/ra_fillValue_test.ino +++ b/examples/ra_fillValue_test/ra_fillValue_test.ino @@ -2,11 +2,13 @@ // FILE: ra_fillValue_test.ino // AUTHOR: Rob Tillaart // DATE: 2012-12-30 -// PUPROSE: demo + timing of fillValue +// PURPOSE: demo + timing of fillValue +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage myRA(10); int samples = 0; diff --git a/examples/ra_getAverageSubset/ra_getAverageSubset.ino b/examples/ra_getAverageSubset/ra_getAverageSubset.ino index 8f4308a..36048e6 100644 --- a/examples/ra_getAverageSubset/ra_getAverageSubset.ino +++ b/examples/ra_getAverageSubset/ra_getAverageSubset.ino @@ -2,11 +2,13 @@ // FILE: ra_getAverageSubset.ino // AUTHOR: Rob Tillaart // DATE: 2012-12-30 -// PUPROSE: show working of runningAverage +// PURPOSE: show working of runningAverage +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage myRA(10); int samples = 0; diff --git a/examples/ra_getValue/ra_getValue.ino b/examples/ra_getValue/ra_getValue.ino index 3693ae1..784c0dd 100644 --- a/examples/ra_getValue/ra_getValue.ino +++ b/examples/ra_getValue/ra_getValue.ino @@ -2,11 +2,13 @@ // FILE: ra_getValue.ino // AUTHOR: Rob Tillaart // DATE: 2020-01-15 -// PUPROSE: demonstrate access in order of the values added +// PURPOSE: demonstrate access in order of the values added +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage myRA(10); int samples = 0; diff --git a/examples/ra_hour/ra_hour.ino b/examples/ra_hour/ra_hour.ino index 549d8b3..f9e7f3d 100644 --- a/examples/ra_hour/ra_hour.ino +++ b/examples/ra_hour/ra_hour.ino @@ -2,13 +2,15 @@ // FILE: runningAverageHour.ino // AUTHOR: Rob Tillaart // DATE: 2012-12-30 -// PUPROSE: show working of runningAverage per hour +// PURPOSE: show working of runningAverage per hour // in 2 steps - last minute + last hour // 3 or more steps also possible +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage raMinute(60); RunningAverage raHour(60); diff --git a/examples/ra_partial/ra_partial.ino b/examples/ra_partial/ra_partial.ino index 526a136..03211c9 100644 --- a/examples/ra_partial/ra_partial.ino +++ b/examples/ra_partial/ra_partial.ino @@ -2,11 +2,13 @@ // FILE: ra_partial.ino // AUTHOR: Rob Tillaart // DATE: 2021-05-26 -// PUPROSE: demonstrate partial use of internal buffer +// PURPOSE: demonstrate partial use of internal buffer +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage myRA(25); int samples = 0; diff --git a/examples/ra_performance/ra_performance.ino b/examples/ra_performance/ra_performance.ino index b26d539..0f17bd8 100644 --- a/examples/ra_performance/ra_performance.ino +++ b/examples/ra_performance/ra_performance.ino @@ -2,11 +2,13 @@ // FILE: ra_performance.ino // AUTHOR: Rob Tillaart // DATE: 2020-04-16 -// PUPROSE: timing of runningAverage +// PURPOSE: timing of runningAverage +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage myRA(50); int samples = 0; diff --git a/examples/ra_test/ra_test.ino b/examples/ra_test/ra_test.ino index c3c973c..c9465ef 100644 --- a/examples/ra_test/ra_test.ino +++ b/examples/ra_test/ra_test.ino @@ -2,11 +2,13 @@ // FILE: ra_test.ino // AUTHOR: Rob Tillaart // DATE: 2012-12-30 -// PUPROSE: show working of runningAverage +// PURPOSE: show working of runningAverage +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage myRA(10); int samples = 0; diff --git a/examples/ra_two_sensors/ra_two_sensors.ino b/examples/ra_two_sensors/ra_two_sensors.ino index c5cc5a7..272bb25 100644 --- a/examples/ra_two_sensors/ra_two_sensors.ino +++ b/examples/ra_two_sensors/ra_two_sensors.ino @@ -2,11 +2,13 @@ // FILE: ra_two_sensors.ino // AUTHOR: Rob Tillaart // DATE: 2020-12-06 -// PUPROSE: show working of runningAverage for two sensors +// PURPOSE: show working of runningAverage for two sensors +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage RAT(10); RunningAverage RAH(10); diff --git a/examples/ra_two_step/ra_two_step.ino b/examples/ra_two_step/ra_two_step.ino index 1dd7135..19f9acc 100644 --- a/examples/ra_two_step/ra_two_step.ino +++ b/examples/ra_two_step/ra_two_step.ino @@ -1,11 +1,13 @@ // // FILE: ra_two_step.ino // AUTHOR: Rob Tillaart -// PUPROSE: demo two stage statistics. +// PURPOSE: demo two stage statistics. +// URL: https://github.com/RobTillaart/RunningAverage #include "RunningAverage.h" + RunningAverage raHours(24); // holds hourly measurements RunningAverage raDays(14); // holds min and max of the last seven days. diff --git a/library.json b/library.json index f92dc9d..b15057d 100644 --- a/library.json +++ b/library.json @@ -15,7 +15,7 @@ "type": "git", "url": "https://github.com/RobTillaart/RunningAverage.git" }, - "version": "0.4.4", + "version": "0.4.5", "license": "MIT", "frameworks": "*", "platforms": "*", diff --git a/library.properties b/library.properties index 119ab6d..25baca8 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=RunningAverage -version=0.4.4 +version=0.4.5 author=Rob Tillaart maintainer=Rob Tillaart sentence=The library stores the last N individual values in a circular buffer to calculate the running average.