Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned long timeLapsed, tick;
- void loop() {
- timeLapsed = millis();
- if (digitalRead(6) == 0 && timeLapsed - tick >= 1000) {
- tick = timeLapsed;
- if (pres == 0) {
- x++;
- x2++;
- //delay(1000);
- pres = 1;
- }
- } else {
- pres = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement