Rank: 231043 based on 0 downloads (last 30 days) and 0 file submitted
photo

Nathan Crosty

E-mail
Company/University
Ford Motor Company

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Nathan Crosty View all
Updated File Comments Rating
29 Apr 2013 Device Drivers Developing Simulink Device Driver Blocks: Step-By-Step Guide and Examples Author: Giampiero Campa

@Classroom Resources,
That was the trick. I can now use any library I wish in the S-Function builder. Thank you very much

29 Apr 2013 Device Drivers Developing Simulink Device Driver Blocks: Step-By-Step Guide and Examples Author: Giampiero Campa

@phil,
I added this line to my Library/Object/Source files pane in the s-function builder. It seems to take care of the path issue.

INC_PATH C:\arduino-1.0.3\libraries\Time

28 Apr 2013 Device Drivers Developing Simulink Device Driver Blocks: Step-By-Step Guide and Examples Author: Giampiero Campa

Hello,
I tried to follow your example and it worked great for interfaces that are in Arduino.h such as digital and analog IO. I ran into problems when trying to include other Arduino Libraries.

I noticed that you had included "AFMotor.cpp" and "AFMotor.h" in your examples, which I guess is similar what I am attempting with "DS1307RTC.h" and "DS1307RTC.cpp" which are libraries for keeping time.

I can build the sfunction with the sfunction builder when it is structured like you have it in your examples. When I go to build the applicaiton, however, I run into an issue that seems to be related to cpp code when the compiler is expecting c code. I am using the Arduino integration package found here http://www.mathworks.com/matlabcentral/fileexchange/30277-embedded-coder-support-package-for-arduino

The compiler message I get when it attempts to build the header file with a class definition is this:

C:/ARDUIN~1.3/hardware/tools/avr/bin//avr-gcc -c -mmcu=atmega2560 -I. -DF_CPU=16000000 -Os -Wall -Wstrict-prototypes -std=gnu99 -I. -I.. -IC:/PROGRA~1/MATLAB/R2011a/rtw/c/ert -IC:/PROGRA~1/MATLAB/R2011a/extern/include -IC:/PROGRA~1/MATLAB/R2011a/simulink/include -IC:/PROGRA~1/MATLAB/R2011a/rtw/c/src -IC:/PROGRA~1/MATLAB/R2011a/rtw/c/src/ext_mode/common -Ic:/OU_SYSTEMS_ENG/GH/gh-dev/Simulink_Models/Drivers/GH_TopLevel_Test_arduino -Ic:/OU_SYSTEMS_ENG/GH/gh-dev/Simulink_Models/Drivers -Ic:/OU_SYSTEMS_ENG/GH/gh-dev/Simulink_Models -Ic:/OU_SYSTEMS_ENG/GH/gh-dev/Simulink_Models/Custom_Includes -Ic:/OU_SYSTEMS_ENG/GH/gh-dev/Simulink_Models/ArduinoML/blocks -IC:/arduino-1.0.3/hardware/arduino/variants/mega2560 -IC:/arduino-1.0.3/hardware/arduino/cores/arduino -IC:/arduino-1.0.3/libraries/Time -IC:/arduino-1.0.3/libraries/DS1307RTC -Ireferenced_model_includes -I../slprj/arduino/_sharedutils -IC:/ARDUIN~1.3/hardware/arduino/cores/arduino ../sfun_systime_get_wrapper.c -o sfun_systime_get_wrapper.o
In file included from ../sfun_systime_get_wrapper.c:39:
C:/arduino-1.0.3/libraries/DS1307RTC/DS1307RTC.h:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'DS1307RTC'
../sfun_systime_get_wrapper.c:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sysTime'

Please let me know if you have any thoughts. I am wondering if this is still an issue with the newer Arduino support in later versions of ML/Simulink.

12 Mar 2013 Embedded Coder Target for Arduino Custom target for Arduno and other processors Author: MathWorks Embedded Coder Team

I've gone ahead and created a tutorial for integrating the new Arduino 1.0.3 libraries in with this support package. There are some directions in this post that I have borrowed from to compose it, but I thought it would be useful to keep everything in once place.
http://ncrosty.thefbox.net/wordpress/?p=199

Contact us