SHARE
TWEET

123

a guest Apr 18th, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define button 8
  2. #define led2 7
  3. #define led1 5
  4. #define led 6
  5.  
  6. void setup() {
  7.  pinMode(led,OUTPUT);
  8.  pinMode(led1,OUTPUT);
  9.  pinMode(led2,OUTPUT);
  10.  pinMode(button,INPUT_PULLUP);
  11.  
  12. }
  13.  
  14. void loop() {
  15. while(digitalRead(button) == LOW){
  16.   digitalWrite(led2,LOW);
  17.   digitalWrite(led,LOW);
  18.   digitalWrite(led1,LOW);
  19.   delay(1000);
  20.   digitalWrite(led2,HIGH);
  21.   delay(1000);
  22. }
  23. digitalWrite(led2,LOW);
  24. digitalWrite(led1,HIGH);
  25. delay(4000);
  26. digitalWrite(led2,HIGH);
  27. delay(1000);
  28. digitalWrite(led1,LOW);
  29. digitalWrite(led2,LOW);
  30. digitalWrite(led,HIGH);
  31. delay(5000);
  32. digitalWrite(led,LOW);
  33. digitalWrite(led2,HIGH);
  34. delay(1000);
  35. digitalWrite(led2,LOW);
  36.  
  37.     }
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