Talking vending machine

9 ビュー (過去 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 件のコメント
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 件)

カテゴリ

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by