Untitled

 avatar
unknown
plain_text
a year ago
727 B
7
Indexable
void startTimer() {   

 

  

 

  lcd.clear();   

 

  

 

  lcd.setCursor(0, 0);   

 

  

 

  lcd.print("Timer started!");   

 

  

 

    

 

  

 

  while (minutes > 0 || seconds > 0) {   

 

  

 

    updateTimerDisplay();   

 

  

 

    delay(1000);   

 

  

 

    seconds--;   

 

  

 

    

 

  

 

    if (seconds < 0) {   

 

  

 

      minutes--;   

 

  

 

      seconds = 59;   

 

  

 

    }   

 

  

 

  }   

 

  

 

    

 

  

 

  lcd.clear();   

 

  

 

  lcd.setCursor(0, 0);   

 

  

 

  lcd.print("Timer finished!");   

 

  

 

    

 

  

 

  // 倒數結束後重置時間並重新開始倒數   

 

  RGBLED_blink(); 

 

  RGBLED_OFF(); 

  

 

}   
Editor is loading...
Leave a Comment