How Can I Solved This Error In My Arduino Program


#include <pid_v1.h>
//define variables we'll connecting to
double setpoint, input, output;
//specify links , initial tuning parameters
pid mypid(&input, &output, &setpoint,5,2,1, direct); // 1
int potpin = a2; // select input pin potentiometer
int pot = 0; // starts o it's not necessary define it, doesn't change anything
int dir2b= 12; // motor direction
int enablem2 = 10; // motor enabling
void setup () // definine inputs , outputs
{
serial.begin(9600);
pinmode(potpin, input); // define potentiometer input
pinmode(dir2b, output); // set motor pins outputs:
pinmode(enablem2, output); // set motor pins outputs:
digitalwrite(enablem2, high); // set enablepins high motor can turn on:
//initialize variables we're linked to
input = analogread(potpin);
setpoint = 586;
//turn pid on
mypid.setmode(automatic);
}
void loop ()
{
pot= analogread(potpin); // read value of potentiometer
input = pot;
mypid.compute();
int error=(586-pot); // reference=586, measured=pot
int vel=255;
if (-190 < error && error < 0) // if value of potentiometer between -190 , 0 degrees:
{
digitalwrite(dir2b, high);
analogwrite(enablem2,(255-output));
serial.println(255-output);
}
if (190 > error && error > 0) // if value of potentiometer between 190 , 0 degrees:
{
digitalwrite(dir2b, low);
analogwrite(enablem2,output);
serial.println(output);
}
if (error < -190 || error > 190) // if value of potentiometer less -190 or more 190 degrees:
{
digitalwrite(enablem2, low);
}
}



errors:

c:\users\partha\documents\arduino\libraries\pid_v1\pid_v1.cpp: in constructor 'pid::pid(double*, double*, double*, double, double, double, int)':
c:\users\partha\documents\arduino\libraries\pid_v1\pid_v1.cpp:26: error: 'millis' not declared in scope
c:\users\partha\documents\arduino\libraries\pid_v1\pid_v1.cpp: in member function 'void pid::compute()':
c:\users\partha\documents\arduino\libraries\pid_v1\pid_v1.cpp:43: error: 'millis' not declared in scope

if can solve errors..plss tell me possible...

your error here:
quote
c:\users\partha\documents\arduino\libraries\pid_v1\pid_v1.cpp
if can show file, plus .h file, might have better chance of finding it.

please use [code][/code] tags.


Arduino Forum > Using Arduino > Project Guidance > How Can I Solved This Error In My Arduino Program


arduino

Comments