Assignment Program a coffee machine:
You are going to program a coffee machine using the simple state machine design with the event
structure. The following states need to be in your VI.
- Initialize (start up sequence of the machine which takes 4 seconds, display to the user that the
machine is starting up)
- Coffee selection (Two buttons in this state: a stop button to stop and shut down the machine and a
order coffee button. The order coffee button will prompt a user input selecting which coffee he
wants. Make sure you have at least two options in there and display the price together with the two
options.)
- Insert coins state (In this state a coin is inserted in the machine. Simulate this by using three
buttons. A button for 1 euro, button for 0.50 euro and 0.10 euro.)
- Price reached state (there must be a stated where you determine if there is enough money inserted
into the machine. If there is enough inserted you continue to the next state, if not you let the user
insert a new coin.)
- Change state (decision making if there is change. If there is give change back, if there is not give out
product.)
- Give change state (give change back and then give out product. After you give out the coffee you go
back to the select coffee state.)
Tips:
- Use local variables to send write and read information in the different steps. For example if you
need to “send” the price of the coffee to the price reached state.
- Use a string indicator or whatever you can find to indicate to the user in what state the machine
currently is.
- You can use an indicator to display to the user what coffee he ordered, how much he still has to pay
and whatever information you think is useful
- Make sure that when you are in the select coffee state a new customer does not see what the
previous customer ordered, payed, received in change.