I have tried and tried but cannot get the sketch to see the .h and .cpp files. I have tried many methods to download and install the sketch from GitHub.
Accessed the .zip directly from the IDE "Add library" tab. (It does work on other files most of the time.)
Added the files in the main sketch folder
Added the files in the in the examples folder with the Arduino sketch file.
IDE error upon verifying the file:
[/b] hp5082_7302_timer.ino.ino:21:29: fatal error: HPNumberDisplay.h: No such file or directory
compilation terminated.
Error compiling.
the .h & .cpp files are shown on the tabs next to the sketch.
Accessed the .zip directly from the IDE "Add library" tab. (It does work on other files most of the time.)
I'm guessing(since you didn't post a link) that you downloaded the library at GitHub - AndSk/ArduinoLibraries: Various useful libraries for the Arduino. Because there are 2 libraries in that repository the "Add Library" tool in the Arduino IDE won't correctly install the libraries so you will have to manually install them by copying the HPNumberDisplay and TimeCounter folders from the downloaded zip file to the libraries folder that is in your sketchbook folder(for the location of your sketchbook folder see File > Preferences > Sketchbook location:) then restart the Arduino IDE.
radioampdoc:
2. Added the files in the main sketch folder
I'm not sure what that means
radioampdoc:
3. Added the files in the in the examples folder with the Arduino sketch file.
That will work if you change the line
#include <HPNumberDisplay.h>
to
#include "HPNumberDisplay.h"
in hp5082_7302_timer.ino.ino and HPNumberDisplay.cpp but really it's best to install a library as a library so that you can access it from multiple sketches and since you probably also didn't correctly install the TimeCounter library you will have to go through the same process for that library also.
For those who would like to help, please pretend you are going to use this sketch and please tell me how to get it to compile. I have had no luck so far. Only been able to get the libraries manually installed. (Thanks to Pert!)
I'm still getting the same error on compilation. The .cpp and .h files are showing on the tabs next to the sketch. The IDE is ignoring this for some reason.
Do you see HPNumberDisplay listed under the Contributed Libraries section of Sketch > Include Library? That would indicate that it was correctly installed.
now it reads this:
hp5082_7302_timer.ino:18:33: fatal error: Scheduler/Scheduler.h: No such file or directory
the scheduler.h file is in the library menu showing as scheduler-master. I know this because it's in the directory and it writes #include scheduler.h at the top of the sketch if I "Add" the library.
That's strange because line 18 of the hp5082_7302_timer.ino.ino you posted is:
#include <Scheduler.h>
Which is correct but there is a bug in the Scheduler library that also causes that error. In {your sketchbook folder}\libraries\Scheduler-master\Scheduler.cpp Change the line:
Well, good for you!! I edited that line in 3 places after doing a global search for #include <Scheduler/Scheduler.h>
Found one hiding in a cpp file. that was the last one! Whew! You da Man!
I've been building and programming my own pc's since the DOS days (black and white screens with no graphics) and I have yet to learn how the IDE looks for files and where they have to live so they will end up in the right places during compilation.
Thank you and God bless you for sharing your knowledge!
RR
radioampdoc:
I have yet to learn how the IDE looks for files and where they have to live so they will end up in the right places during compilation.
There are several locations where included files can be located(in order of where the Arduino IDE looks for them):
{sketchbook}/libraries
hardware/{vendor}/{architecture}/libraries - this is dependent on what you have selected in Tools > Board
{arduino IDE install folder}/libraries
If you use the #include "foo.h" syntax instead of #include <foo.h> it will look for the file in the sketch folder in addition to the library folders.
Files that have the same name as the folder that contains them will have precedence over files that have a different name from the folder.
So a hardware specific version of a library can be included with a boards package in the hardware folder and it will override the stock library that comes with the Arduino IDE and you can put your own custom version of the library in your sketchbook/libraries folder and that will override all other versions of the library.
radioampdoc:
Well, good for you!! I edited that line in 3 places after doing a global search for #include <Scheduler/Scheduler.h>
Found one hiding in a cpp file. that was the last one! Whew! You da Man!
I've been building and programming my own pc's since the DOS days (black and white screens with no graphics) and I have yet to learn how the IDE looks for files and where they have to live so they will end up in the right places during compilation.
Thank you and God bless you for sharing your knowledge!
RR
I got to DOS through CP/M. Got mixed feelings about that.
With Arduino, and this may have been fixed, I've found that if you intend to edit the library files in those tabs that when you save, it goes to the project folder in your sketchbook even if your #include points to the IDE Libraries folder where you want and that's the file that compiles without your edits saved in the project folder, not the Libraries folder.
What worked for me is keep the .h and .cpp in the project folder as a private copy until finished.