Facebook
From Innocent Hummingbird, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 214
  1. void stoper2 ( int Min2, int Sec2){
  2.     if(Min2==0 && Sec2==0){
  3.     M2=0;
  4.     S2=1;}
  5.     lcd.setCursor(2,1);
  6.  lcd.print(":");
  7.  unsigned long currentTime = millis();
  8.   if (currentTime - previousTime >= Interwal){
  9.  S2--;
  10.  previousTime = currentTime;
  11.  if(S2<0)
  12.  {
  13.    M2--;
  14.    S2=59;
  15.  }
  16.  if(M2>9)
  17.  {
  18.    lcd.setCursor(0,1);
  19.    lcd.print(M2);
  20.  }
  21.  else
  22.  {
  23.    lcd.setCursor(0,1);
  24.    lcd.print("0");
  25.    lcd.setCursor(1,1);
  26.    lcd.print(M2);
  27.    lcd.setCursor(2,1);
  28.    lcd.print(":");
  29.  }
  30.   if(S2>9)
  31.  {
  32.    lcd.setCursor(3,1);
  33.    lcd.print(S2);
  34.  }
  35.  else
  36.  {
  37.    lcd.setCursor(3,1);
  38.    lcd.print("0");
  39.    lcd.setCursor(4,1);
  40.    lcd.print(S2);
  41.    }
  42.   if (M2 == 0 && S2 == 0){
  43.     M2 = Min2;
  44.     S2 = Sec2;
  45.   }
  46. }}
  47.