Accueil / Voiture RC / 1/18 Stadium Truck / 1/18 Stadium Truck - Kit Lumière

02

Avr

2014

1/18 Stadium Truck - Kit Lumière Imprimer Envoyer
Écrit par john_lenfr   

Installation d'un kit lumières personnalisé sur mon 1/18 Stadium Truck

VIDEO:


PHOTOS DU MONTAGE:



LE CODE ARDUINO:

/* Knight Rider 3
 * --------------
 *
 * This example concentrates on making the visuals fluid.
 *
 *
 * (cleft) 2005 K3, Malmo University
 * @author: David Cuartielles
 * @hardware: David Cuartielles, Aaron Hallborg
 */
 
int pinArray[] = {2, 3, 4, 5, 6};
int pinArray2[] = {7, 8, 9, 10, 11};
int count = 0;
int i = 0;
int timer = 50;
int timer2 = 100;
int t1 = 100;
 
void setup(){
  for (count=0;count<5;count++) {
    pinMode(pinArray[count], OUTPUT);
    pinMode(pinArray2[count], OUTPUT);
  }
}
 
void loop() {
  for (i=0;i<30;i++) {
        for (count=0;count<4;count++) {
         digitalWrite(pinArray[count], HIGH);
         digitalWrite(pinArray2[count], HIGH);
         delay(timer);
         digitalWrite(pinArray[count + 1], HIGH);
         digitalWrite(pinArray2[count + 1], HIGH);
         delay(timer);
         digitalWrite(pinArray[count], LOW);
         digitalWrite(pinArray2[count], LOW);
         delay(timer*2);
        }
        for (count=4;count>0;count--) {
         digitalWrite(pinArray[count], HIGH);
         digitalWrite(pinArray2[count], HIGH);
         delay(timer);
         digitalWrite(pinArray[count - 1], HIGH);
         digitalWrite(pinArray2[count - 1], HIGH);
         delay(timer);
         digitalWrite(pinArray[count], LOW);
         digitalWrite(pinArray2[count], LOW);
         delay(timer*2);
        }
  }
 
 
  delay(100);
 
 
  for (i=0;i<30;i++) {
      for (count=0;count<5;count++) {
        digitalWrite(pinArray[count], HIGH);
        digitalWrite(pinArray2[count], HIGH);
        delay(timer);
      }
      for (count=0;count<5;count++) {
        digitalWrite(pinArray[count], LOW);
        digitalWrite(pinArray2[count], LOW);
        delay(timer);
      }
  }
delay(100);
 
 
  for (i=0;i<30;i++) {
      for (count=0;count<5;count++) {
        digitalWrite(pinArray[count], HIGH);
        digitalWrite(pinArray2[count], HIGH);
 
      }
      delay(100);
      for (count=0;count<5;count++) {
        digitalWrite(pinArray[count], LOW);
        digitalWrite(pinArray2[count], LOW);
      }
      delay(100);
  }
 
delay(100);
 
 
 
    for (i=0;i<30;i++) {
            digitalWrite(pinArray[0], HIGH);
            digitalWrite(pinArray[4], HIGH);
            digitalWrite(pinArray2[0], HIGH);
            digitalWrite(pinArray2[4], HIGH);
            delay(t1);
            digitalWrite(pinArray[0], LOW);
            digitalWrite(pinArray[4], LOW);
            digitalWrite(pinArray2[0], LOW);
            digitalWrite(pinArray2[4], LOW);
            digitalWrite(pinArray[1], HIGH);
            digitalWrite(pinArray[3], HIGH);
            digitalWrite(pinArray2[1], HIGH);
            digitalWrite(pinArray2[3], HIGH);
            delay(t1);
            digitalWrite(pinArray[1], LOW);
            digitalWrite(pinArray[3], LOW);
            digitalWrite(pinArray2[1], LOW);
            digitalWrite(pinArray2[3], LOW);
            digitalWrite(pinArray[2], HIGH);
            digitalWrite(pinArray2[2], HIGH);        
            delay(t1);       
            digitalWrite(pinArray[2], LOW);
            digitalWrite(pinArray2[2], LOW);       
            delay(t1);
      }
delay(100);
 
for (i=0;i<30;i++) {
            digitalWrite(pinArray[0], HIGH);
            digitalWrite(pinArray[4], HIGH);
            digitalWrite(pinArray2[0], HIGH);
            digitalWrite(pinArray2[4], HIGH);
            delay(t1);
            digitalWrite(pinArray[0], LOW);
            digitalWrite(pinArray[4], LOW);
            digitalWrite(pinArray2[0], LOW);
            digitalWrite(pinArray2[4], LOW);
            digitalWrite(pinArray[1], HIGH);
            digitalWrite(pinArray[3], HIGH);
            digitalWrite(pinArray2[1], HIGH);
            digitalWrite(pinArray2[3], HIGH);
            delay(t1);
            digitalWrite(pinArray[1], LOW);
            digitalWrite(pinArray[3], LOW);
            digitalWrite(pinArray2[1], LOW);
            digitalWrite(pinArray2[3], LOW);
            digitalWrite(pinArray[2], HIGH);
            digitalWrite(pinArray2[2], HIGH);       
            delay(t1);       
            digitalWrite(pinArray[2], LOW);
            digitalWrite(pinArray2[2], LOW);       
            delay(t1);
            digitalWrite(pinArray[1], HIGH);
            digitalWrite(pinArray[3], HIGH);
            digitalWrite(pinArray2[1], HIGH);
            digitalWrite(pinArray2[3], HIGH);
            delay(t1);
            digitalWrite(pinArray[1], LOW);
            digitalWrite(pinArray[3], LOW);
            digitalWrite(pinArray2[1], LOW);
            digitalWrite(pinArray2[3], LOW);
            digitalWrite(pinArray[0], HIGH);
            digitalWrite(pinArray[4], HIGH);
            digitalWrite(pinArray2[0], HIGH);
            digitalWrite(pinArray2[4], HIGH);
            delay(t1);
            digitalWrite(pinArray[0], LOW);
            digitalWrite(pinArray[4], LOW);
            digitalWrite(pinArray2[0], LOW);
            digitalWrite(pinArray2[4], LOW);
      }
 
 
}