We are pleased to present you with the latest discovery in computer communication....
We have found an easy alternative on how to get the Arduino to communicate with the computer through MatLab... i.e. matlab them-selves have designed a program to do just that.
The only things we have to do is modify the code on the MatLab side to except more functions(e.g. lcd.Write) and "completely" rewrite the one on the arduino side to accommodate only the functions we need(no need for communiction to encoders or servos...yet) and to add the support for functions like lcd.write.
For the next few steps we needed the specific programs:
We will need a text-editor (notepad on windows does work but I prefer
notepad++ for its functionallity) to be able to edit the code for MatLab, and the program for the
arduino.
The package that contains the program files to communicate with the arduino are available to download at
Mathworks.
From the package there are only two file that are needed:
1) arduino.m
And from the pde folder
2) adio.pde
To link MatLab to the arduino you will need to:
1) connect the arduino to the computer
2) open the adio.pde in the arduino software
3) upload the program to the arduino
4) check the com port by going to tools and serial
5) open matlab and close the arduino software
6) cd to where you have the arduino.m file
6.1) find the directory by right clicking and selecting properties and copying the text next to "Location:"
6.2) type "cd( ' **the location** ' )" press enter
7) type "a=arduino ('COM#')" and press enter (COM# is the com port you found earlier)
You will now be linked to the Arduino.
You will be able to set the pin states and read and write to the pins.