Skip to content

Commit

Permalink
fix examples (#17)
Browse files Browse the repository at this point in the history
- fix examples
- removed some obsolete comments.
- minor edits
  • Loading branch information
RobTillaart authored Jan 2, 2024
1 parent 1a2bcd8 commit 04811d4
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 29 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.3.0] - 2023-10-18
- update readme.md
## [0.3.2] - 2024-01-02
- fix examples
- removed some obsolete comments.
- minor edits


## [0.3.1] - 2023-10-18
- update readme.md

## [0.3.0] - 2023-01-22
- update GitHub actions
- update license 2023
Expand Down
2 changes: 1 addition & 1 deletion Correlation.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FILE: Correlation.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.3.1
// VERSION: 0.3.2
// PURPOSE: Arduino Library to determine correlation between X and Y dataset
// URL: https://github.com/RobTillaart/Correlation

Expand Down
9 changes: 3 additions & 6 deletions Correlation.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
//
// FILE: Correlation.h
// AUTHOR: Rob Tillaart
// VERSION: 0.3.1
// VERSION: 0.3.2
// PURPOSE: Calculate Correlation from a small dataset.
// URL: https://github.com/RobTillaart/Correlation


#include "Arduino.h"


#define CORRELATION_LIB_VERSION (F("0.3.1"))
#define CORRELATION_LIB_VERSION (F("0.3.2"))


class Correlation
Expand Down Expand Up @@ -55,7 +55,7 @@ class Correlation

// Y = A + B * X
// note if no elements are added or calculate is not called
// the values for A and B are 0
// the values for A and B are 0
float getA() { return _a; };
float getB() { return _b; };

Expand Down Expand Up @@ -102,9 +102,6 @@ class Correlation
float getSumXY(); // replaces getSumXiYi()
float getSumX2(); // replaces getSumXi2()
float getSumY2(); // replaces getSumYi2()
// float getSumXiYi() { return _sumXiYi; }; // obsolete in version 0.3.0
// float getSumXi2() { return _sumXi2; }; // obsolete in version 0.3.0
// float getSumYi2() { return _sumYi2; }; // obsolete in version 0.3.0


private:
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) 2020-2023 Rob Tillaart
Copyright (c) 2020-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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Returns false if nothing to calculate **count == 0**
- **void setE2Calculation(bool)** enables / disables the calculation of Esquared.
- **bool getE2Calculation()** returns the flag set.


After the calculation the following functions can be called to return the core values.
- **float getA()** returns the A parameter of formula **Y = A + B \* X**
- **float getB()** returns the B parameter of formula **Y = A + B \* X**
Expand Down
4 changes: 2 additions & 2 deletions examples/correlation_debugging/correlation_debugging.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// FILE: correlation_debugging.ino
// AUTHOR: Rob Tillaart
// DATE: 2020-05-17
// PUPROSE: demo of the Correlation Library
// PURPOSE: demo of the Correlation Library
// URL: https://github.com/RobTillaart/Correlation


Expand Down Expand Up @@ -59,7 +59,7 @@ void setup()

for (int i = 0; i < SIZE; i++)
{
C.setXY(i, 0, 0); // create flatliner;
C.setXY(i, 0, 0); // create flatliner;
}
Serial.println("cnt\tX\tY");
for (int i = 0; i < SIZE; i++)
Expand Down
2 changes: 1 addition & 1 deletion examples/correlation_demo0/correlation_demo0.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// FILE: demo0.ino
// AUTHOR: Rob Tillaart
// DATE: 2020-05-17
// PUPROSE: demo of the Correlation Library
// PURPOSE: demo of the Correlation Library
// URL: https://github.com/RobTillaart/Correlation


Expand Down
4 changes: 2 additions & 2 deletions examples/correlation_demo1/correlation_demo1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// FILE: correlation_demo1.ino
// AUTHOR: Rob Tillaart
// DATE: 2020-05-17
// PUPROSE: demo of the Correlation Library
// PURPOSE: demo of the Correlation Library
// URL: https://github.com/RobTillaart/Correlation


Expand Down Expand Up @@ -49,5 +49,5 @@ void loop()
}


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

4 changes: 2 additions & 2 deletions examples/correlation_performance/correlation_performance.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// FILE: correlation_performance.ino
// AUTHOR: Rob Tillaart
// DATE: 2020-05-18
// PUPROSE: demo of the Correlation Library
// PURPOSE: demo of the Correlation Library
// URL: https://github.com/RobTillaart/Correlation

// performance test: only ADD and CALCULATE as these are the most used
Expand Down Expand Up @@ -141,5 +141,5 @@ void loop()
}


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

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// FILE: correlation_statistical.ino
// AUTHOR: Rob Tillaart
// DATE: 2020-05-17
// PUPROSE: demo of the Correlation Library
// PURPOSE: demo of the Correlation Library
// URL: https://github.com/RobTillaart/Correlation


Expand Down
4 changes: 2 additions & 2 deletions examples/correlation_test/correlation_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// FILE: correlation_test.ino
// AUTHOR: Rob Tillaart
// DATE: 2020-05-18
// PUPROSE: demo of the Correlation Library
// PURPOSE: demo of the Correlation Library
// URL: https://github.com/RobTillaart/Correlation

// performance test:
Expand Down Expand Up @@ -73,7 +73,7 @@ void setup()
Serial.print("R: ");
Serial.println(R, 6);

// test();
// test();
Serial.println("\nDone...");
}

Expand Down
12 changes: 6 additions & 6 deletions examples/demo_running_correlation/demo_running_correlation.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// FILE: demo_running_correlation.ino.ino
// AUTHOR: Rob Tillaart
// DATE: 2020-05-18
// PUPROSE: demo of the Correlation Library
// PURPOSE: demo of the Correlation Library
// URL: https://github.com/RobTillaart/Correlation


Expand All @@ -16,8 +16,8 @@ void setup()
Serial.begin(115200);
Serial.println(__FILE__);

// when internal table is full, no new values are added
// resulting in stabilization of the regression params A and B
// when internal table is full, no new values are added
// resulting in stabilization of the regression params A and B
C.clear();
C.setRunningCorrelation(false);
for (int i = 0; i <= 1000; i++)
Expand All @@ -28,8 +28,8 @@ void setup()
Serial.println();
Serial.println();

// when internal table is full, values are overwritten and
// there is no stabilization of the regression params A and B
// when internal table is full, values are overwritten and
// there is no stabilization of the regression params A and B
C.clear();
C.setRunningCorrelation(true);
for (int i = 0; i <= 1000; i++)
Expand Down Expand Up @@ -64,5 +64,5 @@ void loop()
}


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

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/Correlation.git"
},
"version": "0.3.1",
"version": "0.3.2",
"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=Correlation
version=0.3.1
version=0.3.2
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino Library to determine correlation between X and Y dataset
Expand Down
3 changes: 2 additions & 1 deletion test/unit_test_001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,5 +184,6 @@ unittest(test_calculate_flags)

unittest_main()

// --END OF FILE --

// -- END OF FILE --

0 comments on commit 04811d4

Please sign in to comment.