I have tried several ways to get this to happen but to no avail. I am a newbe and was pleased to get my basic sketch to work fine but adding the blink in several different ways didn't work. i have spent two weeks trying to find a solution. It must be right under my nose. I'm 62 yo and this is my first programming effort my brain must be atrophying. Code follows.
/*Sequence 7-10 lights from bottom to top of driveway
or top to bottom from PIR input at top or bottom.
If top sequences is initiated first the top most
and bottom most light will light first,
then top to bottom sequence will continue
until complete then remain on for one minute
then all will go off. The same if the bottom
sequence is initiated first only in reverse. */
/*Added whistle blink the led at the oppisite end of
the driveway to indicate if soomeone is coming up,
or down as the case may be*/
// Initialize pins as input and output
int topPir = 2; //digital input for top pir
int bottomPir = 3; //digital input for bottom pir
int outPin4 = 4; //output for bottom light or relay
int outPin5 = 5;
int outPin6 = 6;
int outPin7 = 7;
int outPin8 = 8;
int outPin9 = 9;
int outPin10 = 10;
int outPin11 = 11;
int outPin12 = 12; //output for top light or relay
void setup()
{
pinMode(topPir, INPUT); //declare topPir as input
pinMode(bottomPir, INPUT); //declare bottomPir as input
pinMode(outPin4, OUTPUT); // declare outPin4 as output
pinMode(outPin5, OUTPUT); // declare outPin5 as output
pinMode(outPin6, OUTPUT); // declare outPin6 as output
pinMode(outPin7, OUTPUT); // declare outPin7 as output
pinMode(outPin8, OUTPUT); // declare outPin8 as output
pinMode(outPin9, OUTPUT); // declare outPin9 as output
pinMode(outPin10, OUTPUT); // declare outPin10 as output
pinMode(outPin11, OUTPUT); // declare outPin11 as output
pinMode(outPin12, OUTPUT); // declare outPin12 as outputq
}
void loop ()
{
if (digitalRead(topPir) == HIGH)//checks topPir condition
{
digitalWrite(outPin4, HIGH); //turns output outPin4 on
digitalWrite(outPin12, HIGH); //I want to blink this one
delay(1000); //delays for one second
digitalWrite(outPin5, HIGH); //turn on output outPin5
delay(1000); //delay
digitalWrite(outPin6, HIGH); //same as above until end of
delay(1000); //loop
digitalWrite(outPin7, HIGH);
delay(1000);
digitalWrite(outPin8, HIGH);
delay(1000);
digitalWrite(outPin9, HIGH);
delay(1000);
digitalWrite(outPin10, HIGH);
delay(1000);
digitalWrite(outPin11, HIGH);
delay(1000);
digitalWrite(outPin12, HIGH);
delay(60000); //all outputs on for one minute
digitalWrite(outPin4, LOW); //turns all outPins off
digitalWrite(outPin5, LOW);
digitalWrite(outPin6, LOW);
digitalWrite(outPin7, LOW);
digitalWrite(outPin8, LOW);
digitalWrite(outPin9, LOW);
digitalWrite(outPin10, LOW);
digitalWrite(outPin11, LOW);
digitalWrite(outPin12, LOW);
}
if (digitalRead(bottomPir) == HIGH)//checks bottomPir condition
{
digitalWrite(outPin12, HIGH); //turns output outPin12 on
digitalWrite(outPin4, HIGH); // blink this while rest of code runs
delay(1000); //delays for one second
digitalWrite(outPin11, HIGH); //turn on output outPin12
delay(1000); //delay
digitalWrite(outPin10, HIGH); //same as above until end of
delay(1000); //loop
digitalWrite(outPin9, HIGH);
delay(1000);
digitalWrite(outPin8, HIGH);
delay(1000);
digitalWrite(outPin7, HIGH);
delay(1000);
digitalWrite(outPin6, HIGH);
delay(1000);
digitalWrite(outPin5, HIGH);
delay(1000);
digitalWrite(outPin4, HIGH);
delay(60000); //all outputs on for one minute
digitalWrite(outPin4, LOW); //turns all outPins off
digitalWrite(outPin5, LOW);
digitalWrite(outPin6, LOW);
digitalWrite(outPin7, LOW);
digitalWrite(outPin8, LOW);
digitalWrite(outPin9, LOW);
digitalWrite(outPin10, LOW);
digitalWrite(outPin11, LOW);
digitalWrite(outPin12, LOW);
}
}
Thanks Duff

