Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest May 17th, 2018 102 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. volatile int contador = 0;
  2. int n = contador;
  3.  
  4. long t = 0;
  5. void setup() {    
  6.  
  7.     pinMode(2, INPUT_PULLUP);
  8.     attachInterrupt( 0, incrementaContador, FALLING);
  9. }
  10.  
  11. void loop() {  
  12.     if (n != contador) {
  13.         n = contador;
  14.     }
  15. }
  16.  
  17. void incrementaContador() {
  18.  
  19.     if ( millis() > (t + 50) ) {
  20.         contador++ ;
  21.         t = millis();
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top