SHARE
TWEET

unasolavoltaquandorestabassoilpin

a guest Jan 21st, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int led = 13;
  2.  
  3. int presenza =8;
  4. int presenzastate =0;
  5.  
  6. void setup (){
  7.   pinMode (led,OUTPUT);
  8.   pinMode (presenza,INPUT);
  9.  
  10.  
  11.  
  12.  
  13.   }
  14.   void loop (){
  15.    
  16.  
  17.     presenzastate=digitalRead(presenza);
  18.      bool fallingEdge = false;
  19. if(presenzastate == LOW && !fallingEdge){
  20. fallingEdge = true;
  21. digitalWrite (led,HIGH);
  22. delay(3000);
  23. digitalWrite(led,LOW);
  24. delay(3000);
  25. }
  26. if(presenzastate) fallingEdge = false;
  27.  
  28.   }
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