Skip to content

Commit

Permalink
Fixed Issue #4
Browse files Browse the repository at this point in the history
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?
  • Loading branch information
br3ttb committed Oct 5, 2012
1 parent 8ab93be commit 7c03cf3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions PID_AutoTune_v0/PID_AutoTune_v0.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef PID_AutoTune_v0
#define PID_AutoTune_v0
#define LIBRARY_VERSION 0.0.0
#define LIBRARY_VERSION 0.0.1

class PID_ATune
{
Expand Down Expand Up @@ -40,7 +40,7 @@ class PID_ATune
int sampleTime;
int nLookBack;
int peakType;
double lastInputs[100];
double lastInputs[101];
double peaks[10];
int peakCount;
bool justchanged;
Expand Down
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**********************************************************************************************
* Arduino PID AutoTune Library - Version 0.0.0
* Arduino PID AutoTune Library - Version 0.0.1
* by Brett Beauregard <[email protected]> brettbeauregard.com
*
* This Library is ported from the AutotunerPID Toolkit by William Spinelli
Expand Down

0 comments on commit 7c03cf3

Please sign in to comment.