I created a project using Arduino as an IDF component. The test program works.
I then added my own library function. The library function uses Arduino and therefore has a "# include Arduino.h" statement.
For the library function I get "fatal error: Arduino.h: No such file or directory."
The directory structure is:
-AKArduinoTest/
---CMakeLists.txt
---main/
-----main.cpp
-----CMakeLists.txt
---esp_idf_components/
---components/
-----arduino/
-----Temp18x20/
--------include/
-----------Temp18x20.h
--------Temp18x20.cpp
--------CMakeLists.txt
Any suggestions?
Using Arduino as an IDF component: fatal error: Arduino.h: No such file or directory
Re: Using Arduino as an IDF component: fatal error: Arduino.h: No such file or directory
I believe I need a CMakeLists.txt entry so that Temp18x20 will access the Arduino library just like main.cpp.
Adding the 3rd line below starts compilation but error are thrown when other portions of the Arduino Library are not found.
The CMakeLists.txt file in Temp18x20:
Adding the 3rd line below starts compilation but error are thrown when other portions of the Arduino Library are not found.
The CMakeLists.txt file in Temp18x20:
Code: Select all
idf_component_register(SRCS "Temp18x20.cpp"
INCLUDE_DIRS "include"
PRIV_INCLUDE_DIRS "../arduino/cores/esp32")
Re: Using Arduino as an IDF component: fatal error: Arduino.h: No such file or directory
Here is the CMakeLists.txt file for the Temp18x20 directory:
And then you have to add the OneWIre library and it's CMakeLists.txt files
Code: Select all
idf_component_register(SRCS "Temp18x20.cpp"
INCLUDE_DIRS "include"
REQUIRES arduino OneWire)
Who is online
Users browsing this forum: Baidu [Spider] and 306 guests