Advertisement
UrQuan

Untitled

May 13th, 2015
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.80 KB | None | 0 0
  1. void stop(){
  2.     while(digitalRead(2) != HIGH){
  3.         delay(10);
  4.     }
  5.     while(digitalRead(2) == HIGH){
  6.         delay(10);
  7.     }
  8. }
  9.  
  10. void setup(){
  11.     pinMode ( 2, INPUT);
  12.  
  13.     pinMode ( 8, OUTPUT);
  14.     pinMode ( 9, OUTPUT);
  15.     pinMode ( 10, OUTPUT);
  16.     pinMode ( 11, OUTPUT);
  17.     pinMode ( 12, OUTPUT);
  18. }
  19.  
  20. void loop() {      
  21.     stop();    
  22.     digitalWrite ( 8, HIGH);   
  23.     digitalWrite ( 9, LOW);
  24.     digitalWrite ( 10, HIGH);
  25.     digitalWrite ( 11, LOW);
  26.     digitalWrite ( 12, LOW);
  27.     stop();        
  28.     digitalWrite ( 8, LOW);
  29.     digitalWrite ( 9, HIGH);
  30.     stop();    
  31.     digitalWrite ( 9, LOW);
  32.     digitalWrite ( 8, HIGH);
  33.     digitalWrite ( 10, HIGH);
  34.     stop();
  35.     digitalWrite ( 11, HIGH);
  36.     stop();
  37.     digitalWrite ( 10, LOW);
  38.     digitalWrite ( 11, LOW);
  39.     digitalWrite ( 12, HIGH);
  40.     stop();
  41.     digitalWrite ( 12, LOW);
  42.     digitalWrite ( 11, HIGH);
  43.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement