Including libraries in S-function which are installed on Raspberry pi

5 views (last 30 days)
I am creating an S function which will write on I2C on raspberry pi. I need to include library WiringPi which have everything prepared for communication over I2C. Later I will do same for SPI communication.
I get the error
fatal error C1083: Cannot open include file: 'wiringPi.h': No such file or directory
which is obvious because it's installed only on raspberry pi.
thanks
  2 Comments
Kaustubha Govind
Kaustubha Govind on 6 Aug 2013
Does the error occur when you're compiling the S-function MEX-file, or when you're generating code from the model?

Sign in to comment.

Answers (1)

Denis
Denis on 7 Aug 2013
Edited: Denis on 7 Aug 2013
I would thank to guys at http://www.minseg.com, for great guidance to this guide http://www.mathworks.com/matlabcentral/fileexchange/39354-device-drivers, I managed to get something working using wiringPi library, they also have some examples of how it's done. I have one simple question. Where is S-function builder do you define variable so it can be used in initialization as ID of device which will be some unsigned integer, and then used in output pane.
thanks
  3 Comments
Denis
Denis on 9 Aug 2013
nope because I can't change it then, or at least it wont allow me to change it.
Kaustubha Govind
Kaustubha Govind on 12 Aug 2013
Denis: Are you changing it during simulation or before simulation starts? For the former, it needs to be declared as a tunable parameter, and for the latter it can be either tunable or non-tunable.

Sign in to comment.

Categories

Find more on Raspberry Pi Hardware 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!