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

lcd.print(“Pass>”);
                     while(activated) {
                     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(k,1);
                         lcd.print(“*”);
                         k++;
                       }
                     }
                     if (k > 9 || keypressed == ‘#’) {
                       tempPassword = “”;

                       k=5;
                       lcd.clear();
                       lcd.setCursor(0,0);
                       lcd.print(“ *** ALARM *** “);
                       lcd.setCursor(0,1);
                       lcd.print(“Pass>”);
                     }
                     if ( keypressed == ‘*’) {
                       if ( tempPassword == password ) {
                         activated = false;
                         alarmActivated = false;

                         noTone(buzzer);
                         screenOffMsg = 0;
                       }







           212
   215   216   217   218   219   220   221   222   223   224   225