PIR Sensor and Knight Rider

Hello Every,
I'm a college student learning about arduino for my digital sculpture class. My group partner and I have been working and researching on how to get a pir sensor to activate a knight rider effect. any ideas or sources you can help with, we can get the pir sensor to read, but it will not get the knight rider to activate. I copied and pasted the code we are using below.

int pinArray[] = {2, 3, 4, 5, 6, 7};
int count = 0;
int timer = 30;

void setup(){
for (count=0;count<6;count++) {
pinMode(pinArray[count], OUTPUT);
}
}

void loop() {
for (count=0;count<5;count++) {
digitalWrite(pinArray[count], HIGH);
delay(timer);
digitalWrite(pinArray[count + 1], HIGH);
delay(timer);
digitalWrite(pinArray[count], LOW);
delay(timer2);
}
for (count=5;count>0;count--) {
digitalWrite(pinArray[count], HIGH);
delay(timer);
digitalWrite(pinArray[count - 1], HIGH);
delay(timer);
digitalWrite(pinArray[count], LOW);
delay(timer
2);
}
}

There's nothing there that reads an input, so your PIR is simply not part of the sketch.
You need to define and configure an input to attach the PIR to.
Then simply put an "if" around the main part of the stuff inside "loop()", where the "if" condition is a read of the state of the PIR input.
http://arduino.cc/en/Reference/DigitalRead

this is the program my partner wrote, this is not working at all either

int pin0 = 0;
int pin1 = 1;
int pin2 = 2;
int pin3 = 3;
int pin4 = 4;
int pin5 = 5;
int pin6 = 6;
int pin7 = 7;
int pin8 = 8;
int pin9 = 9;
int pin10 = 10;
int pin11 = 11;
int timer = ;
int pir = 13;
int pirVal = 0;

void setup(){
pinMode(pin0, OUTPUT);
pinMode(pin1, OUTPUT);
pinMode(pin2, OUTPUT);
pinMode(pin3, OUTPUT);
pinMode(pin4, OUTPUT);
pinMode(pin5, OUTPUT);
pinMode(pin6, OUTPUT);
pinMode(pin7, OUTPUT);
pinMode(pin8, OUTPUT);
pinMode(pin9, OUTPUT);
pinMode(pin10, OUTPUT);
pinMode(pin11, OUTPUT);
pinMode(pir, INPUT);

}

void loop() {
if(digitalRead(pir) == HIGH)

digitalWrite(pin0, HIGH);
delay(timer);
digitalWrite(pin0, LOW);
delay(timer);

digitalWrite(pin1, HIGH);
delay(timer);
digitalWrite(pin1, LOW);
delay(timer);

digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);

digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);

digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);

digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);

digitalWrite(pin6, HIGH);
delay(timer);
digitalWrite(pin6, LOW);
delay(timer);

digitalWrite(pin7, HIGH);
delay(timer);
digitalWrite(pin7, LOW);
delay(timer);

digitalWrite(pin8, HIGH);
delay(timer);
digitalWrite(pin8, LOW);
delay(timer);

digitalWrite(pin9, HIGH);
delay(timer);
digitalWrite(pin9, LOW);
delay(timer);

digitalWrite(pin10, HIGH);
delay(timer);
digitalWrite(pin10, LOW);
delay(timer);

digitalWrite(pin11, HIGH);
delay(timer);
digitalWrite(pin11, LOW);
delay(timer);

digitalWrite(pin10, HIGH);
delay(timer);
digitalWrite(pin10, LOW);
delay(timer);

digitalWrite(pin9, HIGH);
delay(timer);
digitalWrite(pin9, LOW);
delay(timer);

digitalWrite(pin8, HIGH);
delay(timer);
digitalWrite(pin8, LOW);
delay(timer);

digitalWrite(pin7, HIGH);
delay(timer);
digitalWrite(pin7, LOW);
delay(timer);

digitalWrite(pin6, HIGH);
delay(timer);
digitalWrite(pin6, LOW);
delay(timer);

digitalWrite(pin5, HIGH);
delay(timer);
digitalWrite(pin5, LOW);
delay(timer);

digitalWrite(pin4, HIGH);
delay(timer);
digitalWrite(pin4, LOW);
delay(timer);

digitalWrite(pin3, HIGH);
delay(timer);
digitalWrite(pin3, LOW);
delay(timer);

digitalWrite(pin2, HIGH);
delay(timer);
digitalWrite(pin2, LOW);
delay(timer);

digitalWrite(pin1, HIGH);
delay(timer);
digitalWrite(pin1, LOW);
delay(timer);

}

Whatever you do with this, don't put it on your car. If you do put it on your car, don't add the "whoosh-whoosh" scanner sound. If you do add the sound, don't take any pictures and post them on the internet. If you do take pictures, don't stand next to the car. If you do stand next to the car, then be prepared to be ridiculed about the cheesy "Knight Rider" system you set up on your Datsun Z-80 (along with your clothes) in 20 years. Unless its a restored Pontiac Firebird/Trans-Am with the custom body panels/pieces - then you'll just be ridiculed as a rich dork.

Remember kids, what may "look cool" now, won't be cool when you get older. You'll also find that somebody else did it long before you, especially from something like "Knight Rider".

You've been warned...

:wink:

Cheesy visual effects notwithstanding,

void loop() {
 if(digitalRead(pir) == HIGH)
 
   digitalWrite(pin0, HIGH);

this code will only affect whether pin0 is set HIGH at the start of the loop. You need some additional { and } around all the digitalWrite and delay statements.

this is not working at all either

"working" is relative.
Your sketch probably compiles and runs.
That it does not do what you want/expect it to do is entirely something else.

Hint: if you look at the first sketch, you'll notice that it is much more compact than your second sketch. Whilst program size is not necessarily an issue o itself, smaller code gives the bugs fewer places to hide, and usually makes debugging easier.