user29676: i'm stuck with a little problem. I need to create a program that can store a number via keypad (this number will be chosen by the user) and then do something with it. To be more specific i will create a temperature control in which the user will be able to input a value of temperature they need and then with this value control a heater, but that's another story, the main point here is that the program needs to be able to store a value via keypad. 
i use the keypad library and some of its commands like getKey() and waitForKey() and so on. 
thanks for your answers!  

user20245: There are many issue when interfacing a processor to a physical switch.  So many that this one question can and has been broken down into several separate questions here on this web site:

How to de-bounce a switch has been asked many times including here.
How to use pull up resistors with a switch has been asked many times including here.
How to scan a switch matrix has been asked many times including here.

Add to that, you need to decide how to parse your data.  

Will you always expect 2 digits?
If so, What will you do if the user enters 3 digits?
Will you support a back-space feature?
Hows about a clear-entry feature?
What about a enter-key feature?

Fortunately many of these questions are addressed in this tutorial.  

user15180: http://playground.arduino.cc/Code/Keypad#Example here is the setup for you, you should see, what you are pressing.
then try something like this:
int temp=0;
bool in_press=false;
void loop() {
  char key = keypad.getKey();
  if (in_press &&  key == NO_KEY){ in_press=false; return;} // key released
  if ( ! in_press ){ 
    if (key != NO_KEY){ // if key is just pressed - proceed it
      in_press=true;
      if (key == '*') {temp=0; return;} //cancel input
      if (key == "#') { do_something_with(temp); temp=0;return;} //accept input
      // key is '0'..'9' - add it to result
      temp= temp*10 + (key-'0'); // maybe check it temp is not too high ...
      return;
    } 
  } 
  // this pass of loop no new key was pressed, do anything else to do
  // if we want, we can test in_press to see, if key is holded or not
  // or ignore it at all
  do_other_stuff_like_blinking_leds_or_what();
} // end of loop()


29676: <p>i'm stuck with a little problem. I need to create a program that can store a number via keypad (this number will be chosen by the user) and then do something with it. To be more specific i will create a temperature control in which the user will be able to input a value of temperature they need and then with this value control a heater, but that's another story, the main point here is that the program needs to be able to store a value via keypad. </p>

<p>i use the keypad library and some of its commands like getKey() and waitForKey() and so on. </p>

<p>thanks for your answers!  </p>
 20245: <p>There are many issue when interfacing a processor to a physical switch.  So many that this one question can and has been broken down into several separate questions here on this web site:</p>

<ol>
<li><p>How to de-bounce a switch has been asked many times including <a href="https://arduino.stackexchange.com/questions/17443/how-to-simulate-delay-to-debounce-mechanical-button-using-millis">here</a>.</p></li>
<li><p>How to use pull up resistors with a switch has been asked many times including <a href="https://arduino.stackexchange.com/questions/25353/why-are-pull-up-resistors-needed">here</a>.</p></li>
<li><p>How to scan a switch matrix has been asked many times including <a href="https://arduino.stackexchange.com/questions/31885/need-help-in-circuit-diagram-of-88-reed-switch-matrix">here</a>.</p></li>
</ol>

<p>Add to that, you need to decide how to parse your data.  </p>

<ul>
<li>Will you always expect 2 digits?</li>
<li>If so, What will you do if the user enters 3 digits?</li>
<li>Will you support a back-space feature?</li>
<li>Hows about a clear-entry feature?</li>
<li>What about a enter-key feature?</li>
</ul>

<p>Fortunately many of these questions are addressed in <a href="http://playground.arduino.cc/Main/KeypadTutorial" rel="nofollow noreferrer">this tutorial</a>.  </p>
 15180: <p><a href="http://playground.arduino.cc/Code/Keypad#Example" rel="nofollow noreferrer">http://playground.arduino.cc/Code/Keypad#Example</a> here is the setup for you, you should see, what you are pressing.</p>

<p>then try something like this:</p>

<pre><code>int temp=0;
bool in_press=false;
void loop() {
  char key = keypad.getKey();
  if (in_press &amp;&amp;  key == NO_KEY){ in_press=false; return;} // key released
  if ( ! in_press ){ 
    if (key != NO_KEY){ // if key is just pressed - proceed it
      in_press=true;
      if (key == '*') {temp=0; return;} //cancel input
      if (key == "#') { do_something_with(temp); temp=0;return;} //accept input
      // key is '0'..'9' - add it to result
      temp= temp*10 + (key-'0'); // maybe check it temp is not too high ...
      return;
    } 
  } 
  // this pass of loop no new key was pressed, do anything else to do
  // if we want, we can test in_press to see, if key is holded or not
  // or ignore it at all
  do_other_stuff_like_blinking_leds_or_what();
} // end of loop()
</code></pre>
