Guest User

Untitled

a guest
Jul 13th, 2021
33
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. unsigned long VarMillis;
  2. int VarTempo = 3000;
  3. byte contador = 0;
  4.  
  5. void setup() {VarMillis = millis();}
  6.  
  7. void loop() {
  8. if (millis() - VarMillis >= VarTempo) {contador = 0; VarMillis = millis();}
  9. if (digitalRead(5) == HIGH) {contador++;}
  10. if (contador == 3) {
  11. // aqui acontece o evento
  12. }
  13. }
RAW Paste Data