Hi all,
I dowloaded the PID library and the while trying to compile the PID_Basic.ino code that comes as an exemple with the library It shoes this error statement:
/Users/clementkostov/Documents/Arduino/libraries/Arduino-PID-Library-master/PID_v1.cpp: In constructor 'PID::PID(double*, double*, double*, double, double, double, int)':
/Users/clementkostov/Documents/Arduino/libraries/Arduino-PID-Library-master/PID_v1.cpp:46: error: type 'PID' is not a direct base of 'PID'
// The PID_Basic.ino code is as follows
/********************************************************
* PID Basic Example
* Reading analog input 0 to control analog PWM output 3
********************************************************/
#include <PID_v1.h>
#define PIN_INPUT 0
#define PIN_OUTPUT 3
//Define Variables we'll be connecting to
double Setpoint, Input, Output;
//Specify the links and initial tuning parameters
double Kp=2, Ki=5, Kd=1;
PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);
void setup()
{
//initialize the variables we're linked to
Input = analogRead(PIN_INPUT);
Setpoint = 100;
//turn the PID on
myPID.SetMode(AUTOMATIC);
}
void loop()
{
Input = analogRead(PIN_INPUT);
myPID.Compute();
analogWrite(PIN_OUTPUT, Output);
}
I am not very familiar with C++ but I don't understand why a code set as an example in the library folder wouldn't compile...
thank you for your help.
Paul