Go Down

Topic: Matlab>>>Arduino (Read 3719 times) previous topic - next topic

sauyong

I'm currently doing project to control a robotic car , but i need build a Matlab GUI to control the car through my laptop, so how i can interface Matlab with the Arduino to control the motor? i use 2 DC motor which is connect with H-bridge L293D, i can control the motor by using Arduino, but i have no ideal to interface the Arduino with the Matlab GUI, is any example or useful guide for me to interface both of them ???

PaulS

Quote
but i need build a Matlab GUI to control the car through my laptop

Why Matlab? Matlab is a very expensive program to use for this task, unless there are requirements that you have not revealed.

http://arduino.cc/playground/Interfacing/Matlab

sauyong

yup, this is one of the my project requirement..., i follow the guide from there, but it shows this :
a=arduino('port')
??? Undefined function or method 'arduino' for input arguments of type 'char'.


i'm missing some step????

PaulS

There is a link on the playground page to a mathworks site. It would appear that other people have been able to get all the required software installed so that MATLAB can talk to the Arduino. You should be able to, too.

There appears to be a fair amount of information available on the mathworks site, with examples, even.

StickFix

Yes, but the fact is that. The appearing error is that... and I don't know why...
I have installed correctly:
- MATLAB R2010a, 32bit
- FTDI driver to communicate with the arduino MEGA
- Configured the correct COM port

... and the arduino GUI works perfectly, and communicate correctly with the MEGA.

In MATLAB, the commandline I have wroten is:
ArduinoObj=arduino(ComPort);
while ComPort is a valid string with the content of "COM7", which are the actual com port to communicate with the arduino, via ArduinoGUI.

Can you help me, please?
Thank you very very much!
StickFix

StickFix

Ok. The answer is simple.
Thanks to the MATLAB webpage for saying nothing about how to install arduino into MATLAB (such as a plugin).

Watch this video (in spanish) or others in english.
https://www.youtube.com/watch?v=TitVKsC9tX0

Tanks!

mart256

I would not install the Arduino plug-in.

Instead I would use the communication toolbox and use the serial rs232 protocol to comunicate the GUI with Arduino.
You can configure the baudrate, the port COM and the parity, number of stop bits, etc...

Go Up