MrAlvin

Arduino millis() reset hack

Jan 15th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include "wiring.c" // to enable our millis() reset hack
  2.  
  3. int sekunder = 0;
  4. int last_sekunder = 0;
  5. int minutter = 0;
  6.  
  7. void setup() {}
  8.  
  9. void loop{)
  10.  
  11. if( millis() >= 1000 ) {
  12. sekunder++;
  13. last_sekunder = millis();
  14. }
  15.  
  16. if( millis() >= 60000 ) {
  17. minutter++;
  18. timer0_millis = 0;
  19. last_sekunder = 0;
  20. }
  21. }
Add Comment
Please, Sign In to add comment