Hi
I am implementing PID control on a piezoelectric motor. I have been able to operate the motor and read the encoder signal. For PID control, I am using the "ArduPID" Library by PowerBroker2 ArduPID Library
Upon compiling, I get an error saying :
D1:1:10: fatal error: ArduPID.h: No such file or directory
#include <ArduPID.h>
^~~~~~~~~~~
compilation terminated.
exit status 1
ArduPID.h: No such file or directory
I have installed this library from Manage Libraries . I tried downloading and manually adding it by include .Zip Library from Sketch menu. Then I tried copying it to code folder, Sketch folder and the Arduino installation folder/Libraries as well. In every case it says
ArduPID.h: No such file or directory
Sometimes it says :
Multiple libraries were found for "ArduPID.h"
#include <ArduPID.h>
Used: D:\Lab\~\Arduino\libraries\ArduPID
^~~~~~~~~~~
Not used: D:\Lab\~\Arduino\libraries\ArduPID-0.2.0
compilation terminated.
exit status 1
ArduPID.h: No such file or directory
If it has found the library and it is being used then why can't it find the header file?
It is in the src folder. I even copied .h and .cpp files to the main library folder and Arduino code folder as well.
Then I read on this forum and created a new tab with the name "ArduPID.h" and copied all the code there.
Then tried changing <ArduPID.h> into "ArduPID.h", Still getting the same error.
Multiple libraries will happen if you have installed multiple ones like (your example) D:\Lab\~\Arduino\libraries\ArduPID and D:\Lab\~\Arduino\libraries\ArduPID-0.2.0. The IDE will navigate ALL library directories looking for ArduPID.h.
I can't reproduce your issue when compiling the example; only thing is that it also requires PowerBroker's FireTimer.h.
If you navigate to D:\Lab\~\Arduino\libraries\ArduPID, does the file ArduPID.h exist?
I am sorry I forgot to mention, I gave the same treatment to FireTimer.h as well.
and yes, when I navigate the the location .h files exist in the src folder.
With
#include "ArduPID"
it gives following error:
C:\Users\FARRUK~1\AppData\Local\Temp\cct8kfKh.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_D2.ino.cpp.o.1905':
<artificial>:(.text.startup+0x5c): undefined reference to `vtable for ArduPID'
<artificial>:(.text.startup+0x5e): undefined reference to `vtable for ArduPID'
C:\Users\FARRUK~1\AppData\Local\Temp\cct8kfKh.ltrans0.ltrans.o: In function `setup':
D:\Lab\Project\Arduino Approach\D2/D2.ino:60: undefined reference to `ArduPID::begin(double*, double*, double*, double const&, double const&, double const&, pOn const&, dir const&, unsigned int const&, double const&)'
D:\Lab\Project\Arduino Approach\D2/D2.ino:62: undefined reference to `ArduPID::setSampleTime(unsigned int const&)'
D:\Lab\Project\Arduino Approach\D2/D2.ino:63: undefined reference to `ArduPID::setOutputLimits(double const&, double const&)'
D:\Lab\Project\Arduino Approach\D2/D2.ino:64: undefined reference to `ArduPID::setBias(double const&)'
D:\Lab\Project\Arduino Approach\D2/D2.ino:67: undefined reference to `ArduPID::start()'
C:\Users\FARRUK~1\AppData\Local\Temp\cct8kfKh.ltrans0.ltrans.o: In function `loop':
D:\Lab\Project\Arduino Approach\D2/D2.ino:78: undefined reference to `ArduPID::compute()'
D:\Lab\Project\Arduino Approach\D2/D2.ino:80: undefined reference to `ArduPID::debug(Stream*, char const*, unsigned char const&)'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Uno.