필터 지우기
필터 지우기

Talking vending machine

조회 수: 3 (최근 30일)
Sharmen
Sharmen 2011년 2월 25일
I'm current doing my final year project in Talking vending machine for blind, its full software project. How do i set command for each push button. Let say when the user press pushbutttonA the panel should diplay the name of the item and say it out at the same time. I know i have save the voice in wav file but i don't know how to execute the voice when the pushbutton is pressed. Can anyone help me in this. Its very helpful for me.
Thank in advance Sharmen
  댓글 수: 3
Jan
Jan 2011년 2월 25일
What is a "pushbutton"? Do you mean an UICONTROL in a Matlab GUI? If so, how do blind people localize it?
Sharmen
Sharmen 2011년 2월 26일
walter: When i execute the M file, the GUI will be displayed. Since my project is a fully software project i dont have a build a real time machine. Buttons will pressed when clicked on them.
Jan: yes i mean by UICONTROL. Well in the real time machine there will braille on each button so it will be easier for the blind the feel the buttons however my project is fully software so i dont really need to worry how the blind going to press the buttons. My main goal is execute voice to guide the user to purchase their desired item. The machine has to guide the user to locate the buttons, where to insert the money, what they selected, how much is total amount need to pay and calculate the balanced. All these information must be displayed on the panel and talk at the same time.
thannks

댓글을 달려면 로그인하십시오.

채택된 답변

Paulo Silva
Paulo Silva 2011년 2월 25일
If you are using GUIDE to build your GUI you just drag a button to the fig, click on the button with the mouse right button, view callback and select callback, matlab will show you the code that is executed when you press the button, insert the code you want to perform in there.
If you aren't using guide (doing all in a m file), you could just do this
fig=figure;
uicontrol('Style','pushbutton','String','Start',...
'Callback','disp(''You pushed the button'')',...
'Units','Normalized','Position',[0.5 0.5 0.1 0.1],...
'Parent',fig)
or
function samplegui
fig=figure;
uicontrol('Style','pushbutton','String','Start',...
'Callback',@pressingthebutton,...
'Units','Normalized','Position',[0.5 0.5 0.1 0.1],...
'Parent',fig)
function pressingthebutton(a,b)
disp('You pushed the button')
end
end
  댓글 수: 1
Sharmen
Sharmen 2011년 2월 26일
thanks Paulo, i'll use your guide in my codes.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by