Advertisement
vanbwodonk

after

May 20th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. unsigned long timeLapsed, tick;
  2. void loop() {
  3.     timeLapsed = millis();
  4.     if (digitalRead(6) == 0 && timeLapsed - tick >= 1000) {
  5.         tick = timeLapsed;
  6.         if (pres == 0) {
  7.             x++;
  8.             x2++;
  9.             //delay(1000);
  10.             pres = 1;
  11.         }
  12.     } else {
  13.         pres = 0;
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement