Answers.Body: <p>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).</p>
  
  <p>With these in mind, have a look at these example button mappings:</p>
  
  <p>Solution #1:</p>
  
  <ul>
  <li>Button 1: Increase amount by 1</li>
  <li>Button 2: Decrease amount by 1</li>
  <li>Button 3: Confirm</li>
  </ul>
  
  <p>Solution #2:</p>
  
  <ul>
  <li>Button 1: Increase amount by 1; Long press: increase amount while being held</li>
  <li>Button 2: Decrease amount by 1; Long press: decrease amount while being held</li>
  <li>Button 3: Confirm</li>
  </ul>
  
  <p>Solution #3:</p>
  
  <ul>
  <li>Button 1: Add 1</li>
  <li>Button 2: Add 5</li>
  <li>Buttons 1+2 simultaneously: Add 10</li>
  <li>Button 3: Add 20</li>
  <li>Buttons 1+2+3 simultaneously: Confirm</li>
  </ul>
  
  <p>Solution #4:</p>
  
  <ul>
  <li>Button 1: Increase amount by 1</li>
  <li>Button 2: Cancel</li>
  <li>Button 3: Confirm</li>
  </ul>
  
  <p>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 :)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-14T06:37:07.700Z
Answers.LastActivityDate: 2015-08-14T06:37:07.700Z
Answers.UserDisplayName: zovits
Answers.Body: <h2>Use a Motor as Input</h2>
  
  <p>You may be limited by the amount of <em>touch</em> sensors you can use, but you have one very useful form of input that you may not be aware of.</p>
  
  <p>EV3 motors have the ability to provide a value based on rotation in degrees. Adjusting the rotation of the motor by hand, you can input very precise numbers quickly. To rotate the motor easily, attach any Technic wheel/gear to the motor using an axle.</p>
  
  <hr>
  
  <h2>Programming a Basic Dial Input</h2>
  
  <p><img src="https://i.sstatic.net/GWJeg.gif" alt="enter image description here"></p>
  
  <p>Create a <em>unlimited loop block</em>, this will ensure the current rotation value is always updated. Place a <em>rotation sensor block</em>, set to measure in degrees. </p>
  
  <p><img src="https://i.sstatic.net/biJxC.gif" alt="enter image description here"></p>
  
  <p>The rotation sensor is very sensitive, it's almost too sensitive because it makes it very difficult to select a number without jumping to another. I recommend you divide the output from the previous block by any number between 10 to 70 to decrease the sensitivity. (10 being the most sensitive).</p>
  
  <p><img src="https://i.sstatic.net/n6gst.gif" alt="enter image description here"></p>
  
  <p>The divided numbers are now non-integers, we don't want to be able to take out a fraction of a dollar/pound or whatever currency you are using. </p>
  
  <p>Use the <em>round block</em> to round the divided numbers up to a whole number. </p>
  
  <p><img src="https://i.sstatic.net/FyxZh.gif" alt="enter image description here"></p>
  
  <p><strong>Optional:</strong> Add a currency prefix. You can use the text block to add a currency prefix, in this case I used the $ sign. EV3 only excepts the $ currency in text inputs. If you would like to use a different currency you would have to render it as an image.</p>
  
  <p><img src="https://i.sstatic.net/9sKIC.gif" alt="enter image description here"></p>
  
  <p>Display the current amount selected using the display block.</p>
  
  <p><a href="https://i.sstatic.net/DDjXo.png" rel="nofollow noreferrer"><strong>Program Overview</strong></a></p>
  
  <hr>
  
  <h2>Working Example</h2>
  
  <p><a href="https://www.youtube.com/watch?v=L1-KZfophl8" rel="nofollow noreferrer"><img src="https://i.sstatic.net/oDWBO.png" alt="YouTube Link"></a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-01T23:26:14.387Z
Answers.Text: Nice MinuteBot base you have there. ;)
Answers.UserDisplayName: gev
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-01T21:49:51.673Z
Answers.LastActivityDate: 2017-02-15T17:23:46.753Z
Answers.LastEditDate: 2017-02-15T17:23:46.753Z
Answers.UserDisplayName: Ambo100
Body: <p>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. </p>
  
  <p>How can I can make an ATM with a maximum of three input to decide how many 20s, 10s, 5s, and 1s I want.</p>
  
Tags: <ev3><programming>
Title: Making an ATM with an EV3
UserDisplayName: Kyle
ThreadText: # Making an ATM with an EV3
  
  (Asked by: username_0 on 2015-08-14)
  
  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.
  
  **Tags:** ev3, programming
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-08-14. Score: 5
  
  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 :)
  
  
  ---
  
  ### Answer by username_2 on 2015-09-01. Score: 4
  
  ## Use a Motor as Input
  
  You may be limited by the amount of *touch* sensors you can use, but you have one very useful form of input that you may not be aware of.
  
  EV3 motors have the ability to provide a value based on rotation in degrees. Adjusting the rotation of the motor by hand, you can input very precise numbers quickly. To rotate the motor easily, attach any Technic wheel/gear to the motor using an axle.
  
  ---
  
  ## Programming a Basic Dial Input
  
  ![enter image description here](https://i.sstatic.net/GWJeg.gif)
  
  Create a *unlimited loop block*, this will ensure the current rotation value is always updated. Place a *rotation sensor block*, set to measure in degrees.
  
  ![enter image description here](https://i.sstatic.net/biJxC.gif)
  
  The rotation sensor is very sensitive, it's almost too sensitive because it makes it very difficult to select a number without jumping to another. I recommend you divide the output from the previous block by any number between 10 to 70 to decrease the sensitivity. (10 being the most sensitive).
  
  ![enter image description here](https://i.sstatic.net/n6gst.gif)
  
  The divided numbers are now non-integers, we don't want to be able to take out a fraction of a dollar/pound or whatever currency you are using.
  
  Use the *round block* to round the divided numbers up to a whole number.
  
  ![enter image description here](https://i.sstatic.net/FyxZh.gif)
  
  **Optional:** Add a currency prefix. You can use the text block to add a currency prefix, in this case I used the $ sign. EV3 only excepts the $ currency in text inputs. If you would like to use a different currency you would have to render it as an image.
  
  ![enter image description here](https://i.sstatic.net/9sKIC.gif)
  
  Display the current amount selected using the display block.
  
  [**Program Overview**](https://i.sstatic.net/DDjXo.png)
  
  ---
  
  ## Working Example
  
  [![YouTube Link](https://i.sstatic.net/oDWBO.png)](https://www.youtube.com/watch?v=L1-KZfophl8)
  
  > **Comments:**
  > **username_3**: Nice MinuteBot base you have there. ;)  
  
  ---
  
  