SHARE
TWEET

Untitled

FaZeIlLuMiNaTi Nov 18th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int switchState = 0;
  2.  
  3. void setup() {
  4.   pinMode(3, OUTPUT);
  5.   pinMode(4, OUTPUT);
  6.   pinMode(5, OUTPUT);
  7.   pinMode(2, INPUT);
  8. }
  9.  
  10. void loop() {
  11.   switchState = digitalRead(2);
  12.  
  13.   if (switchState == LOW) {
  14.     digitalWrite(3, HIGH);
  15.     digitalWrite(4, LOW);
  16.     digitalWrite(5, LOW);
  17.   }
  18.   else {
  19.     digitalWrite(3, LOW);
  20.     digitalWrite(4, LOW);
  21.     digitalWrite(5, HIGH);
  22.  
  23.     delay(250);
  24.     digitalWrite(4, HIGH);
  25.     digitalWrite(5, LOW);
  26.     delay(250);
  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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top