MATLAB Answers

0

How to write Driver Blocks for Arduino on the new 2012b Version?

phil 님이 질문을 제출함. 11 Mar 2013
Following the guide "Writing a Simulink Device Driver block: a step by step guide" by Campa I have not been able to successfully write my own driver blocks.
Following this manual to the letter and it appears that at the final step when uploading to the board with "Run On Target Hardware" there are compiler issues....which warn about "redefining" certain functions which causes an abort.
I have installed the target support with targetinstaller and I am able to run the standard in/out/servo blocks with no issue. Also my s functions compile with no problems!
opening a model from the examples gives the following... however s functions will still compile fine. Warning: File I/O error on file 'arduino.tlc' Operation that caused an error: find In general\private\openmdl at 13 In open at 159 In uiopen at 196
I can only reason that there is a new method implemented on the R2012b version and I can not find any documentation for it. :( I am using the "realtime.tlc" in the Target selection but some documents mention "arduino tlc"....
Really stuck here any help would be appreciated :)

  댓글 수: 2

Have you tried using the standard arduino blocks first and running on target hardware? You can do a quick setup to make the 13 pin blink and the LED on the hardware should blink. You can do this without changing your hardware setup on the arduino.
Hi Ryan,
Thank you for your answer. I can run any of the standard blocks with no problem...! serial read/write digital pins, pwm's etc... there is no issue.
The issue really just arises when trying to create my own driver block from the manual!... :(
The author is also running 2012b so I am a little confused as to why this is happening...
Maybe the author is not using the rtw.tlc but rather the arduino.tlc in code generation... im stuck :(
Is it also possible that when you create your own driver blocks you can NOT use the arduino blocks from the library?

로그인 to comment.

답변 수: 0


Translated by