arduino code not working with MCR

조회 수: 4 (최근 30일)
A
A 2016년 11월 30일
댓글: Jamie Rodgers 2018년 11월 4일
I was able to successfully run my Arduino-based code in MATLAB- but when I tried to compile the code and run under MCR, it returns errors about Arduino. Does MCR not support Arduino? (2016B)

답변 (1개)

Sid Jhaveri
Sid Jhaveri 2016년 12월 5일
Unfortunately, the support package for arduino is not deployable as of now. The developers are aware of this issue. They may consider providing support in a future release of MATLAB.
  댓글 수: 1
Jamie Rodgers
Jamie Rodgers 2018년 11월 4일
Its a bit pathetic that this functionality is not supported. You have to ask what is the point of an arduino support toolbox that ties up a whole matlab licence if you want to actually do anything with it? I ran into exactly the same problem, and am annoyed at the effort to deploy the undeployable that I wasted until I found this answer. We were trying to use an arduino to control some hardware, and wanted to write (and deploy) a matlab GUI to create a user interface. We wanted to run this on alot of systems, and didn't fancy forking out £2K for a matlab licence for each one, for what was basically a straightforward instrumentation app, not a complete SDK.
Anyway we resolved the problem by not using the Matlab arduino support add in at all. (If it can't be deployed it is a waste of time frankly, imo).
Instead we used the arduino inbuilt IDE (free software) to create an individual sketch file for each of the individual low level commands that we needed to actuate via the GUI (e.g set pin 10 to high). This was quite easy to do once we did a modicum of research into the aduino language. If you can program matlab, arduino is within your capability.
Then we created stand alone binaries (bin files) from each of the sketch files in the arduino IDE.
Then we built matlab functions that used 'system' command to invoke these bin files as needed, and created higher level matlab functions that used sequences of these 'bin' files to create the more sophisticated operations we wanted.
Finally, we built our GUI in Guide and included filepaths to the bin files that we were using within the code.
We deployed the matlab code and then dropped the bin files to the filepaths that the system commands were targetting.
Bingo.
It was a bit of a kerfuffle to set up, but not hugely so, and the final application does exactly what we need, and doess it very well. Fewer problems than with the original GUIs we used from the mathworks interface that used the Arduino support add in in fact.
It is a bit pathetic that Mathowrs don't support deployment of their hardware add ins though! The cynic in me might suggest they are counting on selling licences off the back of people developing the apps they need and finding that these won't work when deployed?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by