I have been struggling with this, and can’t seem to figure out the issue. I’m posting it here rather than the Matlab forum because I think this is more of an issue with the Arduino library. I am trying to write a code in Matlab Simulink that requires the Wire library. I moved the Wire.h and Wire.cpp files to my working folder but I keep getting this error message:
In file included from C:/Users/slb0494/Desktop/LCD/SparkFun_MAG3110.h:24:0, from ../Mag_wrapper.cpp:20: C:/Users/slb0494/Desktop/LCD/Wire.h:25:25: fatal error: include/twi.h: No such file or directory #include <include/twi.h> ^ compilation terminated. gmake: *** [Mag_wrapper.o] Error 1
The board I am using is the Due, and I am using the Due library. Unfortunately I have to create an S-function with the Wire library rather than use the I2C communication blocks from the Arduino support package because I need to communicate with multiple sensors of the same address through an I2C multiplexer. I’ve been looking at other examples of S-functions with the wire library and they all seem to be following the same procedure without issue. I also have another S-function in my model that uses a different library and works fine. Any help would be appreciated!