How to create a DLL file from .cpp and .h in Matlab?

15 ビュー (過去 30 日間)
gdz
gdz 2022 年 12 月 14 日
コメント済み: cr 2022 年 12 月 15 日
I am currently using a temperature module, MAX6675, the library of the module is downloaded from Arduino (see picture). But now I would like to use this library on Matlab.
One of the solution will be creating a DLL file from the header file .h and source file .c from the Arduino library. So that the function inside the source file can be used directly in MATLAB. (Correct me if I'm wrong)
How to create a DLL file from .cpp and .h files in Matlab? Because the Matlab coder and Matlab compiler are only allow .m file to do the conversion.

採用された回答

cr
cr 2022 年 12 月 14 日
編集済み: cr 2022 年 12 月 14 日
You dont need matlab to compile C/cpp files. Just need a c/cpp compiler.
  3 件のコメント
gdz
gdz 2022 年 12 月 15 日
編集済み: gdz 2022 年 12 月 15 日
I used VS to create the dll file, but it failed. The error message said unable open "Arduino.h", “int8_t" is not defined, and "uint8_t" is not defined.Should I try to include "Arduino.h" to the VS? Or Arduino code is not working vs?
cr
cr 2022 年 12 月 15 日
VS can compile c/c++ code and produce you a dll. Needless to mention, all required libraries and headers must be included to compile without errors.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeArduino Hardware についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by