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

activateAlarm = true;
                   }
                   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;







                                                                                                                     209
   212   213   214   215   216   217   218   219   220   221   222