Patronage Laïque Municipal de la Cavale Blanche

Accueil > Culture > Fablab Ado > chenillard K2000

chenillard K2000

samedi 30 janvier 2016 par Antoine

Voici notre projet du jour !

JPEG - 75.6 ko
chenillard K2000 montage
MPEG4 - 4.7 Mo
chenillard_k2000

notre code (logiciel arduino) :

// the setup function runs once when you press reset or power the board
int buttonState = 0;

void setup() {
 // initialize digital pin 13 as an output.
 pinMode(1, OUTPUT);
  pinMode(2, OUTPUT);
 
pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);

pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);

  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);

  pinMode(12, INPUT);
  }  

// the loop function runs over and over again forever

void loop() {

buttonState = digitalRead(12);
if (buttonState == HIGH) {
 
 digitalWrite(1, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(1, LOW);    // turn the LED off by making the voltage LOW
         
 
  digitalWrite(2, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(2, LOW);    // turn the LED off by making the voltage LOW
   

digitalWrite(3, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(3, LOW);    // turn the LED off by making the voltage LOW
         
 
  digitalWrite(4, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(4, LOW);    // turn the LED off by making the voltage LOW
 

digitalWrite(5, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(5, LOW);    // turn the LED off by making the voltage LOW

 
  digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
     


digitalWrite(7, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(7, LOW);    // turn the LED off by making the voltage LOW
           
 
  digitalWrite(8, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(8, LOW);    // turn the LED off by making the voltage LOW






 digitalWrite(7, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(7, LOW);    // turn the LED off by making the voltage LOW
       
 
  digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(6, LOW);    // turn the LED off by making the voltage LOW
   


digitalWrite(5, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(5, LOW);    // turn the LED off by making the voltage LOW

  digitalWrite(4, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(4, LOW);    // turn the LED off by making the voltage LOW



digitalWrite(3, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(3, LOW);    // turn the LED off by making the voltage LOW

  digitalWrite(2, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(2, LOW);    // turn the LED off by making the voltage LOW

digitalWrite(1, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(100);              // wait for a second
 digitalWrite(1, LOW);    // turn the LED off by making the voltage LOW

} else {

digitalWrite(1, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(8, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(100);              // wait for a second

digitalWrite(1, LOW);   // turn the LED on (HIGH is the voltage level)
digitalWrite(8, LOW);   // turn the LED on (HIGH is the voltage level)

digitalWrite(2, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(7, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(100);              // wait for a second

digitalWrite(2, LOW);   // turn the LED on (HIGH is the voltage level)
digitalWrite(7, LOW);   // turn the LED on (HIGH is the voltage level)
           

digitalWrite(3, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(100);              // wait for a second

digitalWrite(3, LOW);   // turn the LED on (HIGH is the voltage level)
digitalWrite(6, LOW);   // turn the LED on (HIGH is the voltage level)


digitalWrite(4, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(5, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(100);              // wait for a second

digitalWrite(4, LOW);   // turn the LED on (HIGH is the voltage level)
digitalWrite(5, LOW);   // turn the LED on (HIGH is the voltage level)

 
 digitalWrite(1, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(8, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(100);              // wait for a second

digitalWrite(1, LOW);   // turn the LED on (HIGH is the voltage level)
digitalWrite(8, LOW);   // turn the LED on (HIGH is the voltage level)

digitalWrite(2, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(7, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(100);              // wait for a second

digitalWrite(2, LOW);   // turn the LED on (HIGH is the voltage level)
digitalWrite(7, LOW);   // turn the LED on (HIGH is the voltage level)
           

digitalWrite(3, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(100);              // wait for a second

digitalWrite(3, LOW);   // turn the LED on (HIGH is the voltage level)
digitalWrite(6, LOW);   // turn the LED on (HIGH is the voltage level)
delay(100);              // wait for a second


digitalWrite(4, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(5, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(100);              // wait for a second

digitalWrite(4, LOW);   // turn the LED on (HIGH is the voltage level)
digitalWrite(5, LOW);   // turn the LED on (HIGH is the voltage level)


digitalWrite(3, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(6, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(100);              // wait for a second

digitalWrite(3, LOW);   // turn the LED on (HIGH is the voltage level)
digitalWrite(6, LOW);   // turn the LED on (HIGH is the voltage level)

digitalWrite(2, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(7, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(100);              // wait for a second

digitalWrite(2, LOW);   // turn the LED on (HIGH is the voltage level)
digitalWrite(7, LOW);   // turn the LED on (HIGH is the voltage level)
           

digitalWrite(1, HIGH);   // turn the LED on (HIGH is the voltage level)
digitalWrite(8, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(100);              // wait for a second

digitalWrite(1, LOW);   // turn the LED on (HIGH is the voltage level)
digitalWrite(8, LOW);   // turn the LED on (HIGH is the voltage level)


}

}

Merci à Melvin ;-)


| Plan du site | Mentions légales | Suivre la vie du site RSS 2.0 | Haut de page | SPIP | ScolaSPIP
Patronage Laïque Municipal de la Cavale Blanche (Patronage Laïque Municipal de la Cavale Blanche)