Pages: [1]   Go Down
Author Topic: Leonardo and MATLAB interface?  (Read 2380 times)
0 Members and 1 Guest are viewing this topic.
Outer Space
Offline Offline
Newbie
*
Karma: 0
Posts: 12
i love to experiment.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,
i have a doubt about the interface between Leonardo and MATLAB.
in the MATLAB Arduino IO package documentation the supported Arduinos shown are Arduino Uno,  Mega 2560, or Duemilanove ,
as Leonardo is not there on the list, let me know whether there is any incompatibilities between
MATLAB and Leonardo?

thanks
Logged

i void warrenties

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 508
Posts: 31395
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
let me know whether there is any incompatibilities between MATLAB and Leonardo?
There is no incompatibility. Everything a Uno can do a Leonardo can do.
In fact the Leonardo can do more because it can look like a USB keyboard or mouse as well.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46029
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Everything a Uno can do a Leonardo can do.
On the other hand, the serial port must be opened using DtrEnable, to talk to the Leonardo. If MATLAB does not use that flag, it can't communicate with the Leonardo.
Logged

Troy, NY, USA
Offline Offline
Newbie
*
Karma: 0
Posts: 20
Finnish in USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Everything a Uno can do a Leonardo can do.
On the other hand, the serial port must be opened using DtrEnable, to talk to the Leonardo. If MATLAB does not use that flag, it can't communicate with the Leonardo.

Has someone tried of getting Leonardo to work with Matlab, and even succeeded in that?

In Python it seems as easy as putting:
Code:
comport.DtrEnable = true;

(e.g. http://www.raspberrypi.org/phpBB3/viewtopic.php?t=16490&p=168611)

So now one should probably modify the Arduino class (arduino.m of the Arduino I/O package) in similar manner? Or simply set the DtrEnable flag to true for the Matlab programs you are about to develop?

I don't have yet Leonardo and was thinking of purchasing one also to be used with Matlab so if someone can confirm in advance that it has worked, it would be great
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Still there is a possible solution for this?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am still having problem in interfacing matlab with leonardo as when i try to make connection(a=arduino('COM5')) the connection is not made and it shows
a=arduino('COM5')
Attempting connection .............
Warning: A timeout occurred before the Terminator was reached.
??? Error using ==> arduino>arduino.arduino at 104
Connection unsuccessful, please make sure that the board is powered on, running a sketch
provided with the package, and connected to the indicated serial port. You might also try to
unplug and re-plug the USB cable before attempting a reconnection.

and at 104 i got in my arduino.m file is
if isempty(a.sktc)
                    delete(a);
                    error('Connection unsuccessful, please make sure that the board is powered on, running a sketch provided with the package, and connected to the indicated serial port. You might also try to unplug and re-plug the USB cable before attempting a reconnection.');
                end
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 46029
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Leonardo requires that DTREnable be set to true. Are you setting that when opening the serial port? The default is to set DTREnable to false, for most software that deals with serial ports.

Also, what software is installed on the Arduino?
Logged

Pages: [1]   Go Up
Jump to: