Making an ATM with an EV3 I am building an ATM using my LEGO Mindstorms EV3, but I  ran across a problem. The problem is that I want to be able to input the amount of money that I want to get out of the ATM but I can only have a maximum of three touch sensors because I'm using the fourth for the ability to have a key so my siblings don't steal money. 

How can I can make an ATM with a maximum of three input to decide how many 20s, 10s, 5s, and 1s I want.
The possible solutions involve realizing that you can multiply the number of possible inputs by implementing long clicks, double clicks, click-and-holds, simultaneous clicks, etc. on the buttons. If I were you, I'd also include a Confirm and maybe a Cancel buttons, but the latter can be substituted by a timeout. You could ease your job if you don't handle the separate bills as individual amounts, but set the requested amount of money and write a function that splits an amount into separate bills (e.g. splitting 58 into 2×20, 1×10, 1×5, 3×1).

With these in mind, have a look at these example button mappings:

Solution #1:


Button 1: Increase amount by 1
Button 2: Decrease amount by 1
Button 3: Confirm


Solution #2:


Button 1: Increase amount by 1; Long press: increase amount while being held
Button 2: Decrease amount by 1; Long press: decrease amount while being held
Button 3: Confirm


Solution #3:


Button 1: Add 1
Button 2: Add 5
Buttons 1+2 simultaneously: Add 10
Button 3: Add 20
Buttons 1+2+3 simultaneously: Confirm


Solution #4:


Button 1: Increase amount by 1
Button 2: Cancel
Button 3: Confirm


Of course each approach requires different sub-solutions (as mentioned above, timeouts, detection of long presses and button holds, simultanous presses, etc.). These are up to you, but if you get stuck, feel free to ask :)