Skip to content

Commit

Permalink
Fix URL in examples + minor edits (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Jan 5, 2024
1 parent dbf3c3c commit e44d126
Show file tree
Hide file tree
Showing 21 changed files with 64 additions and 25 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion RunningAverage.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 5 additions & 2 deletions RunningAverage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion examples/fillValue/fillValue.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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

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

Expand Down
12 changes: 8 additions & 4 deletions examples/ra_FastAverageTest/ra_FastAverageTest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion examples/ra_MinMaxBufferTest/ra_MinMaxBufferTest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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

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

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

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

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

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

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

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

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

Expand Down
4 changes: 3 additions & 1 deletion examples/ra_two_step/ra_two_step.ino
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=RunningAverage
version=0.4.4
version=0.4.5
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=The library stores the last N individual values in a circular buffer to calculate the running average.
Expand Down

0 comments on commit e44d126

Please sign in to comment.