arduino code not working with MCR

1 次查看(过去 30 天)
A
A 2016-11-30
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