Question: You need to design a vending machine controller that should exhibit the following behavior: The vending machine delivers a package of gum after it has

You need to design a vending machine controller that should exhibit the following behavior:
The vending machine delivers a package of gum after it has received 15 cents in coins.
The machine has a single coin slot that accepts only nickels (5cents) and dimes (10cents), one coin at a time.
A sensor indicates to the controller whether a nickel or dime has been inserted in the coin slot.
The controllers output causes a single package of gum to be released when it has received at least 15 cents, and the controller is reset.
The machine does not give change. For example, if two dimes are inserted, it will release the gum and reset. Write the embedded C code to implement the same

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!