how to use simulink generated C/C++ code on arduino IDE

Hi guys

i have a problem.

i have built in simulink a neural network and generated it into C code.

Then i want run the C code on arduino MC.

I got some error on arduino IDE, like:

"
C:\Users\ChenWang\Documents\Arduino\libraries\Copy_of_Viergelenkkette_grt_rtw/simstruc.h:285:3: error: #error Unrecognized use.

C:\Users\ChenWang\Documents\Arduino\libraries\Copy_of_Viergelenkkette_grt_rtw/simstruc.h:357:3: error: #error Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE

error Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE

^
C:\Users\ChenWang\Documents\Arduino\libraries\Copy_of_Viergelenkkette_grt_rtw/simstruc.h:480:3: error: #error Unhandled case

"

does some one have any idea, what i should do?

Thx

upup

Original posting: Today at 10:30 am
upup posting: Today at 01:02 pm

What a pushy person!
:frowning:

I have a problem.
A problem with persons being pushy.

Then i want run the C code on arduino MC.

Perhaps you better run your code on a plattform which is intended to run the code.

Code generators create very inefficient code in most cases, which can not in the least compare with optimized code written by an experienced programmer. Most likely the Arduino platform is not only missing header files for data types your code generator uses, but also lacks the minimum RAM requirements.

downdown

Post the code after you read this before posting a programming question

From the error messages it looks like your library files may be in the wrong place.

sry for my english, it is not my muther language.

the header is already in the arduino lib folder.

but i still got the error.

I saw some example about how to use the simulink generated c/c++ code on visual studio.

but i do not know how to do it on arduino ide.

I only have matlab 2006, so i can not use simulink hardward support package for arduino.

If some one has done this before, pls share the expierenc.

THx a lot

So do this:

ust define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE

error Must define one of RT, NRT, MATLAB_MEX_FILE, SL_INTERNAL, or FIPXT_SHARED_MODULE

Since I don't know simulink, I can;t tell you which to define, and since "arduino" is not one of them, you might have to go in and figure out what each #define is doing and create an equivalent for the Arduino.