Can I include the libraries downloaded with arduino support package directly into my IO device builder block
22 views (last 30 days)
Show older comments
Abdussamad Mohammed
on 25 Nov 2024 at 11:40
Commented: Abdussamad Mohammed
on 3 Dec 2024 at 14:57
Hello Mathworks community,
So I wanted to build a custom simulink block to connect my ESP32 to AWS using IO device builder. some libraries I'm going to need are WiFi and WiFiClientSecure; which are libraries usually included with the ESP32 core and don't need external files to be added. and indeed when I navigate into the files of the support package these libraries are there. but I have found no way of including them into my code without copying the files into my custom block directory.
so my question is: is there a way to directly include them in my code?
0 Comments
Answers (1)
Aravind
on 26 Nov 2024 at 6:48
The core libraries that come with the Arduino Support Package can be directly included in the generated code of the "IO Device Builder" app, so there is no need to manually add or copy these library files into the custom block directory.
In fact, manually adding such libraries can lead to conflicts with the core libraries in the support package, resulting in unexpected behavior. The "IO Device Builder" app is intended for including only external libraries that are not already part of the support package.
Since "WiFi.h" and "WiFiClientSecure.h" are core libraries included in the support package, you can simply use them in the generated ".CPP" file by adding these lines at the top of the file:
#include "WiFi.h"
#include "WiFiClientSecure.h"
I hope this clears up your question.
See Also
Categories
Find more on Modeling in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!