I would like some help please!
I am going to make a vending machine from spare parts I have accumulated from old printers, toys ect.. and i have got a coin sorter for the money!
i am going to have about 6-8 motors to vend the products this will take up 6-8 outputs
I will be using 2 inputs to the arduino from a keypad using different resistance for product selection
I will be using 4 inputs to detect 4 different coins from the sorter £1, 50p, 20p and 10p
i will be needing to use the serial output (serial.begin) to show the amount of credit in the machine.
If i dont use the serial out to show the amount of credit in the machine i will use 3 outputs to light up 3 leds when the credit is at a certain threshold, e.g : led1= 30p+ and led2= 60p+ and led3= £1+
What i need help with is the programming of the money taken with adding it up and storing it in some variable and when the threshold of a value for example "a can of drink" is at 50p, the customer can select the button that corresponds with that item. (items will be, crisps= 50p, drinks 60p and chocolate bars 70p.)
So, how do i make a program that will count the coins up from the different switches being activated by the coins to then be deducted by what ever selection is being made then allowing the machine to vend.
Im quite new to this and would appreciate anyone help!