Advertisement
Mouamle

Looping

Jul 17th, 2015
3,390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. int Fdelay = 250;
  3. int Bdelay = 125;
  4.  
  5. void setup() {
  6.  
  7.   pinMode(3, OUTPUT);
  8.   pinMode(4, OUTPUT);
  9.   pinMode(5, OUTPUT);
  10.   pinMode(6, OUTPUT);
  11. }
  12.  
  13. void loop() {
  14.  
  15.  
  16.   for( int z = 3; z < 7; z++){
  17.     digitalWrite(z, HIGH);
  18.     delay(Fdelay);
  19.     digitalWrite(z, LOW);
  20.  
  21.     if( z >= 6 ){
  22.       for (int i = 6; i >= 3; i--) {
  23.             digitalWrite(i, HIGH);
  24.            delay(Bdelay);
  25.            digitalWrite(i, LOW);
  26.       }
  27.     }
  28.   }
  29.  
  30.  
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement