GUI arduino serial communication
1 回表示 (過去 30 日間)
古いコメントを表示
Hello, I have created a GUI where I am going to capture an image and perform some operations only after I get an interrupt from arduino. Arduino gives interrupt after every 60 sec(It can be anything). So after the first interrupt, I want the camera to take snapshot (meanwhile the timer should be ON at background counting 60 sec). This is what is expected but when I tried to do this either I can access the camera or I can do the serial communication but not both. This is my code:
%Start Your Timer
p1='';
while 1
set(r, 'Timeout',5);
p= fgets(r);
if ~strcmp(p,p1)
if strcmp(p,'N') %Comes after 60 sec
vid= videoinput('winvideo', 1);
axes(handles.axes2);
hImage=image(zeros(640,480,3),'Parent',handles.axes2);
preview(vid,hImage)
end
if strcmp(p,'C') %Comes after 60 sec
%Do something else
end
end
end
How can I do it simultaneously? Any help? Thank you
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で MATLAB Support Package for Arduino Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!