Interacting with Arduino using Matlab

조회 수: 2 (최근 30일)
Manko
Manko 2012년 8월 19일
Hi, I am a new Arduino user here and am hoping to get some help with programming with Matlab.
I downloaded the ArduinoIO() from Mathworks that is made to be used with Arduino. These are the steps I took:
1) In Matlab, typed "install_arduino." I've confirmed that the arduino files are there by testing "help arduino," which returned something instead of an error.
2) Uploaded the adio.pde to the Arduino Uno board using the Arduino IDE.
3) Wrote a simple program to test it. Code below:
a = arduino('/dev/tty.usbmodem1d11');
a.pinMode(13,'output');
a.digitalWrite(13,1);
pause(2);
a.digitalWrite(13,0);
delete(instrfind({'Port'},{'/dev/tty.usbmodem1d11'}));
Matlab will says "attempting connection...." and I will get the message that it connected successfully. But after I wait a few more seconds, I get a message that says "Segmentation violation detected" and a bunch of other messages.
I am running Matlab 7.8.0. on MBP with an Arduino Uno
Any help will be great. Thanks!
Edit Found out the problem is in the delete() command. Whenever Matlab is trying to close the session, it causes the "segmentation violation detected" error. If anyone has an idea on how to fix this, please let me know. Thank you!
  댓글 수: 1
Rolfe Dlugy-Hegwer
Rolfe Dlugy-Hegwer 2012년 8월 23일
In case you're interested, you can install support for Simulink starting in R2012a by typing targetinstaller in the MATLAB Command Window.

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

답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by