Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function submitButton_Callback(hObject, eventdata, handles)
- % hObject handle to submitButton (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- if(get(handles.HitButton,'Value') == 1)
- filename = 'testing.xls';
- writevar({'Hit'},1,filename);
- set(handles.text2,'visible','off');
- set(handles.words,'visible','off');
- set(handles.rating,'visible','on');
- set(handles.readyToGo,'visible','off');
- set(handles.readyButton,'visible','off');
- set(handles.submitButton,'visible','off');
- set(handles.rateButton, 'visible','on');
- set(handles.HowSure,'visible', 'on');
- drawnow;
- sPort=serial('COM4');
- fopen(sPort);
- fprintf(sPort, '%d', 3);
- fclose(sPort);
- delete(sPort);
- else
- filename = 'testing.xls';
- writevar({'Bit'},1,filename);
- set(handles.text2,'visible','off');
- set(handles.words,'visible','off');
- set(handles.rating,'visible','on');
- set(handles.readyToGo,'visible','off');
- set(handles.readyButton,'visible','off');
- set(handles.submitButton,'visible','off');
- set(handles.rateButton, 'visible','on');
- set(handles.HowSure,'visible', 'on');
- drawnow;
- sPort=serial('COM4');
- fopen(sPort);
- fprintf(sPort, '%d', 3);
- fclose(sPort);
- delete(sPort);
- end
- function readyButton_Callback(hObject, eventdata, handles)
- % hObject handle to readyButton (see GCBO)
- % eventdata reserved - to be defined in a future version of MATLAB
- % handles structure with handles and user data (see GUIDATA)
- s = load('train.mat');
- sPort=serial('COM4');
- fopen(sPort);
- fprintf(sPort, '%d', 1);
- player = audioplayer(s.y,8192);
- playblocking(player);
- fprintf(sPort, '%d', 2);
- fclose(sPort);
- delete(sPort);
- %pause(4);
- set(handles.text2,'visible','on');
- set(handles.words,'visible','on');
- set(handles.HowSure,'visible', 'off');
- set(handles.rating,'visible','off');
- set(handles.readyToGo,'visible','off');
- set(handles.readyButton,'visible','off');
- set(handles.submitButton,'visible','on');
- drawnow;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement