4. Light water

4. Light water

Man of few words said, directly on the code:

 

void Setup () {
   // definition of output pins 
  for ( int I = 2 ; I < . 7 ; I ++ ) { 
    the pinMode (I, the OUTPUT); 
  } 
} 

void Loop () {
   // forward lit, then goes out 
  for ( int I = 2 ; I < . 7 ; I ++ ) { 
    digitalWrite (I, HIGH); 
    Delay ( 500 ); 
    digitalWrite (I, the LOW); 
  } 
  // reverse lights, and then off 
  for ( int I = . 5 ; I> . 1 ; i-- ) {
    digitalWrite(i, HIGH);
    delay(500);
    digitalWrite(i, LOW);
  }
}

 

Guess you like

Origin www.cnblogs.com/ltozvxe/p/12328829.html