Trying to use a simple toggle button to start and stop my video processing i get an error.
my code under that of the toggle button being
% Hint: get(hObject,'Value') returns toggle state of startstop
clc; source= videoinput('winvideo');set(source, 'ReturnedColorSpace', 'RGB');set(source, 'FramesPerTrigger', 1);set(source, 'TriggerRepeat', inf);triggerconfig(source, 'manual');start(source);pause(2);trigger(source);if get(handles.startstop,'Value') set(handles.startstop,'String','Stop'); set(handles.startstop,'Value',1); drawnow(); else set(handles.startstop,'String','Start'); set(handles.startstop,'Value',0); clear(source); stop(source);end
i get the following error
??? Error using ==> imaqdevice.start at 91Multiple VIDEOINPUT objects cannot access the same device simultaneously.
Best Answer