Skip to content

Commit 7c03cf3

Browse files
committed
Fixed Issue #4
nLookBack could potentially be 100, in which case 'i' starts at 99, the end of the array, only for lastInputs[100] to eventually be updated. I would think the array should be declared of size 101 to fix this, yes?
1 parent 8ab93be commit 7c03cf3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

PID_AutoTune_v0/PID_AutoTune_v0.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#ifndef PID_AutoTune_v0
22
#define PID_AutoTune_v0
3-
#define LIBRARY_VERSION 0.0.0
3+
#define LIBRARY_VERSION 0.0.1
44

55
class PID_ATune
66
{
@@ -40,7 +40,7 @@ class PID_ATune
4040
int sampleTime;
4141
int nLookBack;
4242
int peakType;
43-
double lastInputs[100];
43+
double lastInputs[101];
4444
double peaks[10];
4545
int peakCount;
4646
bool justchanged;

README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**********************************************************************************************
2-
* Arduino PID AutoTune Library - Version 0.0.0
2+
* Arduino PID AutoTune Library - Version 0.0.1
33
* by Brett Beauregard <[email protected]> brettbeauregard.com
44
*
55
* This Library is ported from the AutotunerPID Toolkit by William Spinelli

0 commit comments

Comments
 (0)