Talking vending machine

1 view (last 30 days)
Sharmen
Sharmen on 25 Feb 2011
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 Comments
Jan
Jan on 25 Feb 2011
What is a "pushbutton"? Do you mean an UICONTROL in a Matlab GUI? If so, how do blind people localize it?
Sharmen
Sharmen on 26 Feb 2011
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

Sign in to comment.

Accepted Answer

Paulo Silva
Paulo Silva on 25 Feb 2011
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 Comment
Sharmen
Sharmen on 26 Feb 2011
thanks Paulo, i'll use your guide in my codes.

Sign in to comment.

More Answers (0)

Categories

Find more on Environment and Settings 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!