title: How to break infinite while in Arduino
body: <p>A-R-D-U-I-N-O circuit that include pad number and a led with this code</p>
  
  <pre><code>char keys[ROWS][COLS] = {
    {'1','2','3','A'},
    {'4','5','6','B'},
    {'7','8','9','C'},
    {'*','0','#','D'}
  };
  
  void setup() {
      pinMode(13,OUTPUT);
      Serial.begin(9600);
  }
  
  void loop() {
      char key = keypad.getKey();
  
      if (key) {
          Serial.println(key);
          switch(key) {
              case 'A': 
              while(1)
              {
                  digitalWrite(13,HIGH);
                  delay(1000);
                  digitalWrite(13,LOW);
                  delay(1000);
              }
          break;
      }
  }
  </code></pre>
  
  <p>How can I make another case e.g. (case 'D') to stop this infinite while loop?</p>