Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/arduino-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: arduino/arduino-lint-action@v1
- uses: actions/checkout@v6
- uses: arduino/arduino-lint-action@v2
with:
library-manager: update
compliance: strict
3 changes: 1 addition & 2 deletions .github/workflows/arduino_test_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ jobs:
runTest:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/jsoncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ on:
paths:
- '**.json'
pull_request:
paths:
- '**.json'

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: json-syntax-check
uses: limitusus/json-syntax-check@v2
with:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.4.9] - 2026-03-19
- update GitHub actions
- add define AVERAGE_MIN_SIZE so at least 1 element.
- minor edits

## [0.4.8] - 2025-08-01
- add array example
- update examples
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-2025 Rob Tillaart
Copyright (c) 2012-2026 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
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ In version 0.2.16 a fix was added that uses the calculation of the sum in **getA
update the internal **\_sum**.


#### Related
### Related

- https://github.com/RobTillaart/Correlation
- https://github.com/RobTillaart/GST - Golden standard test metrics
Expand All @@ -40,6 +40,7 @@ update the internal **\_sum**.
- https://github.com/RobTillaart/RunningAngle
- https://github.com/RobTillaart/RunningAverage
- https://github.com/RobTillaart/RunningMedian
- https://github.com/RobTillaart/RunningMinMax
- https://github.com/RobTillaart/statHelpers - combinations & permutations
- https://github.com/RobTillaart/Statistic
- https://github.com/RobTillaart/Student
Expand Down Expand Up @@ -173,11 +174,6 @@ Indicative performance on an UNO, see examples.
| last functions | - | - | not tested


## Operation

See examples


## Future

#### Must
Expand Down
3 changes: 2 additions & 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.8
// VERSION: 0.4.9
// 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 All @@ -16,6 +16,7 @@
RunningAverage::RunningAverage(const uint16_t size)
{
_size = size;
if (_size < AVERAGE_MIN_SIZE) _size = AVERAGE_MIN_SIZE;
_partial = _size;
_array = (float*) malloc(_size * sizeof(float));
if (_array == NULL) _size = 0;
Expand Down
8 changes: 6 additions & 2 deletions RunningAverage.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// FILE: RunningAverage.h
// AUTHOR: Rob Tillaart
// VERSION: 0.4.8
// VERSION: 0.4.9
// 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 All @@ -14,8 +14,12 @@
#include "Arduino.h"


#define RUNNINGAVERAGE_LIB_VERSION (F("0.4.8"))
#define RUNNINGAVERAGE_LIB_VERSION (F("0.4.9"))

// AVERAGE_MIN_SIZE should at least be 1 to be practical,
#ifndef AVERAGE_MIN_SIZE
#define AVERAGE_MIN_SIZE 1
#endif

class RunningAverage
{
Expand Down
1 change: 0 additions & 1 deletion examples/fillValue/fillValue.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: fillValue.ino
// AUTHOR: Rob Tillaart
// DATE: 2012-12-30
// PURPOSE: demo + timing of fillValue
// URL: https://github.com/RobTillaart/RunningAverage

Expand Down
1 change: 0 additions & 1 deletion examples/ra_300/ra_300.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: ra_300.ino
// AUTHOR: Rob Tillaart
// DATE: 2021-05-26
// PURPOSE: demonstrate large (16 bit) buffer
// URL: https://github.com/RobTillaart/RunningAverage

Expand Down
1 change: 0 additions & 1 deletion examples/ra_300_last/ra_300_last.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: ra_300.ino
// AUTHOR: Rob Tillaart
// DATE: 2021-05-26
// PURPOSE: demonstrate large (16 bit) buffer
// URL: https://github.com/RobTillaart/RunningAverage

Expand Down
1 change: 0 additions & 1 deletion examples/ra_FastAverageTest/ra_FastAverageTest.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: ra_FastAverageTest.ino
// AUTHOR: Rob Tillaart
// DATE: 2015-sep-04
// PURPOSE: demo to see if different average algorithm give different result
// URL: https://github.com/RobTillaart/RunningAverage

Expand Down
1 change: 0 additions & 1 deletion examples/ra_MinMaxBufferTest/ra_MinMaxBufferTest.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: ra_MinMaxBufferTest.ino
// AUTHOR: Rob Tillaart
// DATE: 2015-09-04
// PURPOSE: demo
// URL: https://github.com/RobTillaart/RunningAverage

Expand Down
3 changes: 1 addition & 2 deletions examples/ra_MinMaxTest/ra_MinMaxTest.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: runningAverageMinMaxTest.ino
// FILE: ra_MinMaxTest.ino
// AUTHOR: Rob Tillaart
// DATE: 2015-apr-10
// PURPOSE: demo
// URL: https://github.com/RobTillaart/RunningAverage

Expand Down
1 change: 0 additions & 1 deletion examples/ra_fillValue_test/ra_fillValue_test.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: ra_fillValue_test.ino
// AUTHOR: Rob Tillaart
// DATE: 2012-12-30
// PURPOSE: demo + timing of fillValue
// URL: https://github.com/RobTillaart/RunningAverage

Expand Down
1 change: 0 additions & 1 deletion examples/ra_getAverageSubset/ra_getAverageSubset.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: ra_getAverageSubset.ino
// AUTHOR: Rob Tillaart
// DATE: 2012-12-30
// PURPOSE: show working of runningAverage
// URL: https://github.com/RobTillaart/RunningAverage

Expand Down
1 change: 0 additions & 1 deletion examples/ra_getValue/ra_getValue.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: ra_getValue.ino
// AUTHOR: Rob Tillaart
// DATE: 2020-01-15
// PURPOSE: demonstrate access in order of the values added
// URL: https://github.com/RobTillaart/RunningAverage

Expand Down
1 change: 0 additions & 1 deletion examples/ra_hour/ra_hour.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: runningAverageHour.ino
// AUTHOR: Rob Tillaart
// DATE: 2012-12-30
// PURPOSE: show working of runningAverage per hour
// in 2 steps - last minute + last hour
// 3 or more steps also possible
Expand Down
1 change: 0 additions & 1 deletion examples/ra_partial/ra_partial.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: ra_partial.ino
// AUTHOR: Rob Tillaart
// DATE: 2021-05-26
// PURPOSE: demonstrate partial use of internal buffer
// URL: https://github.com/RobTillaart/RunningAverage

Expand Down
1 change: 0 additions & 1 deletion examples/ra_performance/ra_performance.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: ra_performance.ino
// AUTHOR: Rob Tillaart
// DATE: 2020-04-16
// PURPOSE: timing of runningAverage
// URL: https://github.com/RobTillaart/RunningAverage

Expand Down
1 change: 0 additions & 1 deletion examples/ra_test/ra_test.ino
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//
// FILE: ra_test.ino
// AUTHOR: Rob Tillaart
// DATE: 2012-12-30
// PURPOSE: show working of runningAverage
// URL: https://github.com/RobTillaart/RunningAverage

Expand Down
4 changes: 3 additions & 1 deletion keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ getAverageSubset KEYWORD2


# Constants (LITERAL1)
RUNNINGAVERAGE_LIB_VERSION LITERAL1
RUNNINGAVERAGE_LIB_VERSION LITERAL1

AVERAGE_MIN_SIZE LITERAL1
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.8",
"version": "0.4.9",
"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.8
version=0.4.9
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
Loading