Hi,
working on some kind of remote control and so I need two sketches, tx and rx, but this sketches need to share definitions.
I want to have a .h file which I can include in both sketches. Using 'Add file' doesnt work, always get a 'File not found' error, but you can be sure, the file is there and no typo!!
How can I solve this problem in Arduino IDE?
(( Other IDEs allowing to add/alter a search path, which is a straight foreward and simple method)).
Not sure why you need two sketches, there are lot's of RX/TX examples in a single sketch. But if you insist, put the .h file in your personal library and include it with <>
What syntax did you use in your #include directive?
There are two different styles of syntax that can be used. This syntax:
#include <filename.h>
causes the include path (e.g., where the libraries are installed) to be searched for the file.
This syntax:
#include "filename.h"
causes the local path to be searched, then the include path if the file was not found in the local path.
You can use either syntax to reference a header file from a library, but when the file is located in the sketch folder you must use the double quotes syntax. If you instead use the angle brackets syntax in this case, you will get the "No such file or directory" error, even when the file is present in the sketch.