Page 211 - Tasarım Beceri Atölyeleri Öğretmen El Kitabı
P. 211

EK-6

               else if (keypressed ==’B’) {
                     lcd.clear();

                     int i=1;
                     tone(buzzer, 2000, 100);
                     tempPassword = “”;
                     lcd.setCursor(0,0);
                     lcd.print(“Current Password”);
                     lcd.setCursor(0,1);
                     lcd.print(“>”);
                     passChangeMode = true;
                     passChanged = true;
                     while(passChanged) {
                     keypressed = myKeypad.getKey();

                     if (keypressed != NO_KEY){
                       if (keypressed == ‘0’ || keypressed == ‘1’ || keypressed == ‘2’ || keypressed == ‘3’ ||
                           keypressed == ‘4’ || keypressed == ‘5’ || keypressed == ‘6’ || keypressed == ‘7’ ||
                           keypressed == ‘8’ || keypressed == ‘9’ ) {
                        tempPassword += keypressed;
                        lcd.setCursor(i,1);
                        lcd.print(“*”);
                        i++;

                        tone(buzzer, 2000, 100);
                       }
                     }
                     if (i > 5 || keypressed == ‘#’) {
                       tempPassword = “”;
                       i=1;






                                                                                                                     203
   206   207   208   209   210   211   212   213   214   215   216