MATLAB and Arduino: Ending Communication

Hello all,
This is the first project that I am working on with MATLAB or Arduino. I have experience with C++ and .spin language and I have figured out most of what I need for this particular task. It is very simple: Turn a turntable 45 degrees, take a picture. Do this 3 times and then close out of the program. I will figure out how to trigger the camera and receive pictures at a later date.
I was just wondering if there was any way to stop running the program once I have taken the pictures I need? I have looked at a lot of different places and they suggest just running an empty loop to "stop" the Arduino from doing anything. However, that will not work because I am interfacing that with my MATLAB GUI to where when the pictures are done, I need to return control to MATLAB.
I already posted this on the Arduino forum, but I figured coming here may help. I have already established communication between MATLAB and it operates my Arduino code below without a flaw once a button is pushed. The only problem is that MATLAB believes that their is a connection issue because the Arduino stops sending data back.
Is there a way to send something from Arduino once the pictures are done to end communication between the two? Thanks in advanced for your help.
MATLAB GUI Code: Simple Opening of Arduino
clear ard; %Resets ard
global ard; %Creates a Global Variable for ard
ard = arduino('Com6'); %Opens Arduino on Com6, Change as Necessary
Arduino Code:
Not able to post here well, but the below hyperlink is for the arduino forum where it posted better and you can see what responses I have already had.
Thanks you in advance for your help.

1 Commento

Why can't you just attach your m-file with the paperclip icon???

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su MATLAB Support Package for Arduino Hardware in Centro assistenza e File Exchange

Richiesto:

il 20 Giu 2014

Commentato:

il 20 Giu 2014

Community Treasure Hunt

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

Start Hunting!

Translated by