Advertisement
Guest User

Untitled

a guest
Sep 27th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1.  
  2.  
  3. void loop() {
  4. int washingTime = millis();
  5. unsigned long allSeconds = washingTime / 1000;
  6. int runHours = allSeconds / 3600;
  7. int secsRemaining = allSeconds % 3600;
  8. int runMinutes = secsRemaining / 60;
  9. int runSeconds = secsRemaining % 60;
  10.  
  11. char buf[21];
  12. sprintf(buf, "Koniec prania: %02d:%02d:%02d", runHours, runMinutes, runSeconds);
  13. Serial.println(buf);
  14. delay(1000);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement