Not Declared????

Hello.. I am building a light tree count down timer for our church game night. there will be 12 horizontal rows on a square post, each row with 3 or 4 LEDs. The top LEDs (blue) will be a "get ready", the next 10 rows will be the count down, and the final bottom row will be a "TIMES UP" row. I may hook a buzzer to that output too if there is enough current.

On analog A0 I have a toggle switch (with a pull down resistor) and on A1 I have a push button (also with a pull down resistor). When the toggle is in the "LOW" position, my sketch is set to have each row light up every 1/4 second - a display mode. When you switch the toggle to "HIGH", I want it to go to an "IF/Else" mode. The if/else would have the DigitalPin 13 to HIGH and hold until the pushbutton is pushed. That would activate each row of light for 3 seconds each for a total 30 second timer, followed by a 10 second buzzer and lights to say times up. it would then reset itself back to the digital13 until the pushbutton is pushed again, or the toggle is put back in display mode.

I have read all the reference and tutorial items, and thought I had it right, but when I go to upload my sketch, it keeps giving me errors on the inputs and "IF" statements.

If I do "if (input0=HIGH)" I get input 0 not declared. If I do If (input A0=HIGH) it says Assignment of read only... Nothing works. Here is the sketch. If someone can PLEASE show me (and make corrections) I would truly be thankful. Also, how do I get a debounce? I thought of just cutting and pasting, but as I can not get the basic part to work, I did not want to add more... Thanks again.

void setup() {
  // put your setup code here, to run once:
pinMode (A0, INPUT); //analog input to toggle switch -resistor to ground on return side
pinMode (A1, INPUT); //analog input to push button - resistor to ground on return side
pinMode (13, OUTPUT); //LED = Get Ready - all LED outputs have 3 parallel LEDs with resistors.
pinMode (12, OUTPUT); // LED countdown light 10
pinMode (11, OUTPUT); // LED countdown light 9
pinMode (10, OUTPUT); // LED countdown light 8
pinMode (9, OUTPUT); // LED countdown light 7
pinMode (8, OUTPUT); // LED countdown light 6
pinMode (7, OUTPUT); // LED countdown light 5
pinMode (6, OUTPUT); // LED countdown light 4
pinMode (5, OUTPUT); // LED countdown light 3
pinMode (4, OUTPUT); // LED countdown light 2
pinMode (3, OUTPUT); // LED countdown light 1
pinMode (2, OUTPUT); // LED countdown TIMES UP plus buzzer
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(13, HIGH); //LED quick loop when toggle is in display (low) mode
delay (250);
digitalWrite(13, LOW); //led13 off
digitalWrite(12, HIGH);//led 12 on
delay (250); //  quarter second delay
digitalWrite(12, LOW);// led 12 off
digitalWrite(11, HIGH);
delay (250);
digitalWrite(11, LOW);
digitalWrite(10, HIGH);
delay (250);
digitalWrite(10, LOW);
digitalWrite(9, HIGH);
delay (250);
digitalWrite(9, LOW);
digitalWrite(8, HIGH);
delay (250);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
delay (250);
digitalWrite(7, LOW);
digitalWrite(6, HIGH);
delay (250);
digitalWrite(6, LOW);
digitalWrite(5, HIGH);
delay (250);
digitalWrite(5, LOW);
digitalWrite(4, HIGH);
delay (250);
digitalWrite(4, LOW);
digitalWrite(3, HIGH);
delay (250);
digitalWrite(3, LOW);
digitalWrite(2, HIGH);
delay (250);
digitalWrite(2, LOW);
delay (250);

int analogPin (0);
if (input0=HIGH)
digitalWrite(13, HIGH); // toggle switch on countdown mode (high) LED13 is on until push button activates timer.
if (input1=HIGH) 
digitalWrite(13, LOW); //push button activates countdown timer, turning off 13 and working down timer LEDs at 3 seconds each for 30 second game time.
digitalWrite(12, HIGH);
delay (3000);
digitalWrite(12, LOW);
digitalWrite(11, HIGH);
delay (3000);
digitalWrite(11, LOW);
digitalWrite(10, HIGH);
delay (3000);
digitalWrite(10, LOW);
digitalWrite(9, HIGH);
delay (3000);
digitalWrite(9, LOW);
digitalWrite(8, HIGH);
delay (3000);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
delay (3000);
digitalWrite(7, LOW);
digitalWrite(6, HIGH);
delay (3000);
digitalWrite(6, LOW);
digitalWrite(5, HIGH);
delay (3000);
digitalWrite(5, LOW);
digitalWrite(4, HIGH);
delay (3000);
digitalWrite(4, LOW);
digitalWrite(3, HIGH);
delay (3000);
digitalWrite(3, LOW);
digitalWrite(2, HIGH); //hold for 10 seconds, playing buzzer and light for TIMES UP, then reset to 13
delay (10000);
digitalWrite(2, LOW); //light and buzzer off

}
if (input0=HIGH)

should probably be:

if (digitalRead (A0) == HIGH)

Easy, huh? You have digitalRead() just like you have digitalWrite(). Of course the same goes for input1. Please also mind the double =.

Also this:

int analogPin (0);

is not doing what I think you expect, just remove it.

Please send the whole sketch, not just a snippet.

ok. I made the changes to digitalRead from the above response, and the error messages no longer appear, but all it does now is loops. What is wrong with the If statements??? why does it not loop when the toggle is low? When toggle is High, why does it just keep going instead of waiting for the pushbutton? I am so confused...

Since we can’t see what you changed we can’t very well help, now can we.

You need to put in Serial.print() statements to see what your program is doing.

As already pointed out most of the if statements read like ‘if (x=HIGH)’ which assigns x to be HIGH, it does not do a test. The proper operator to test equality is ==.

What is wrong with the If statements???

Have you changed the = into == ? Please post your whole program as it is now.

void setup() {
  // put your setup code here, to run once:
pinMode (A0, INPUT); //analog input to toggle switch -resistor to ground on return side
pinMode (A1, INPUT); //analog inpu to push button - resistor to ground on return side
pinMode (13, OUTPUT); //LED = Get Ready - all LED outputs have 3 parallel LEDs with resistors.
pinMode (12, OUTPUT); // LED countdown light 10
pinMode (11, OUTPUT); // LED countdown light 9
pinMode (10, OUTPUT); // LED countdown light 8
pinMode (9, OUTPUT); // LED countdown light 7
pinMode (8, OUTPUT); // LED countdown light 6
pinMode (7, OUTPUT); // LED countdown light 5
pinMode (6, OUTPUT); // LED countdown light 4
pinMode (5, OUTPUT); // LED countdown light 3
pinMode (4, OUTPUT); // LED countdown light 2
pinMode (3, OUTPUT); // LED countdown light 1
pinMode (2, OUTPUT); // LED countdown TIMES UP plus buzzer
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(13, HIGH); //LED quick loop when toggle is in display (low) mode
delay (250);
digitalWrite(13, LOW); //led13 off
digitalWrite(12, HIGH);//led 12 on
delay (250); //  quarter second delay
digitalWrite(12, LOW);// led 12 off
digitalWrite(11, HIGH);
delay (250);
digitalWrite(11, LOW);
digitalWrite(10, HIGH);
delay (250);
digitalWrite(10, LOW);
digitalWrite(9, HIGH);
delay (250);
digitalWrite(9, LOW);
digitalWrite(8, HIGH);
delay (250);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
delay (250);
digitalWrite(7, LOW);
digitalWrite(6, HIGH);
delay (250);
digitalWrite(6, LOW);
digitalWrite(5, HIGH);
delay (250);
digitalWrite(5, LOW);
digitalWrite(4, HIGH);
delay (250);
digitalWrite(4, LOW);
digitalWrite(3, HIGH);
delay (250);
digitalWrite(3, LOW);
digitalWrite(2, HIGH);
delay (250);
digitalWrite(2, LOW);
delay (250);

int analogPin (0);
if (digitalRead (A0) == HIGH)
digitalWrite(13, HIGH); // toggle switch on countdown mode (high) LED13 is on until push button activates timer.
if (digitalRead (A1) == HIGH)
digitalWrite(13, LOW); //push button activates countdown timer, turning off 13 and working down timer LEDs at 3 seconds each for 30 second game time.
digitalWrite(12, HIGH);
delay (3000);
digitalWrite(12, LOW);
digitalWrite(11, HIGH);
delay (3000);
digitalWrite(11, LOW);
digitalWrite(10, HIGH);
delay (3000);
digitalWrite(10, LOW);
digitalWrite(9, HIGH);
delay (3000);
digitalWrite(9, LOW);
digitalWrite(8, HIGH);
delay (3000);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
delay (3000);
digitalWrite(7, LOW);
digitalWrite(6, HIGH);
delay (3000);
digitalWrite(6, LOW);
digitalWrite(5, HIGH);
delay (3000);
digitalWrite(5, LOW);
digitalWrite(4, HIGH);
delay (3000);
digitalWrite(4, LOW);
digitalWrite(3, HIGH);
delay (3000);
digitalWrite(3, LOW);
digitalWrite(2, HIGH); //hold for 10 seconds, playing buzzer and light for TIMES UP, then reset to 13
delay (10000);
digitalWrite(2, LOW); //light and buzzer off

}
if (digitalRead (A1) == HIGH)
digitalWrite(13, LOW); //push button activates countdown timer, turning off 13 and working down timer LEDs at 3 seconds each for 30 second game time.
digitalWrite(12, HIGH);
delay (3000);
digitalWrite(12, LOW);
and so on....

Which line(s) of code should be executed when the condition for the if returns true and which should be executed unconditionally ?

void setup() {
  // put your setup code here, to run once:
  pinMode (A0, INPUT); //analog input to toggle switch -resistor to ground on return side
  pinMode (A1, INPUT); //analog inpu to push button - resistor to ground on return side
  pinMode (13, OUTPUT); //LED = Get Ready - all LED outputs have 3 parallel LEDs with resistors.
  pinMode (12, OUTPUT); // LED countdown light 10
  pinMode (11, OUTPUT); // LED countdown light 9
  pinMode (10, OUTPUT); // LED countdown light 8
  pinMode (9, OUTPUT); // LED countdown light 7
  pinMode (8, OUTPUT); // LED countdown light 6
  pinMode (7, OUTPUT); // LED countdown light 5
  pinMode (6, OUTPUT); // LED countdown light 4
  pinMode (5, OUTPUT); // LED countdown light 3
  pinMode (4, OUTPUT); // LED countdown light 2
  pinMode (3, OUTPUT); // LED countdown light 1
  pinMode (2, OUTPUT); // LED countdown TIMES UP plus buzzer
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(13, HIGH); //LED quick loop when toggle is in display (low) mode
  delay (250);
  digitalWrite(13, LOW); //led13 off
  digitalWrite(12, HIGH);//led 12 on
  delay (250); //  quarter second delay
  digitalWrite(12, LOW);// led 12 off
  digitalWrite(11, HIGH);
  delay (250);
  digitalWrite(11, LOW);
  digitalWrite(10, HIGH);
  delay (250);
  digitalWrite(10, LOW);
  digitalWrite(9, HIGH);
  delay (250);
  digitalWrite(9, LOW);
  digitalWrite(8, HIGH);
  delay (250);
  digitalWrite(8, LOW);
  digitalWrite(7, HIGH);
  delay (250);
  digitalWrite(7, LOW);
  digitalWrite(6, HIGH);
  delay (250);
  digitalWrite(6, LOW);
  digitalWrite(5, HIGH);
  delay (250);
  digitalWrite(5, LOW);
  digitalWrite(4, HIGH);
  delay (250);
  digitalWrite(4, LOW);
  digitalWrite(3, HIGH);
  delay (250);
  digitalWrite(3, LOW);
  digitalWrite(2, HIGH);
  delay (250);
  digitalWrite(2, LOW);
  delay (250);

  int analogPin (0);
  if (digitalRead (A0) == HIGH)
    digitalWrite(13, HIGH); // toggle switch on countdown mode (high) LED13 is on until push button activates timer.
  if (digitalRead (A1) == HIGH)
    digitalWrite(13, LOW); //push button activates countdown timer, turning off 13 and working down timer LEDs at 3 seconds each for 30 second game time.
  digitalWrite(12, HIGH);
  delay (3000);
  digitalWrite(12, LOW);
  digitalWrite(11, HIGH);
  delay (3000);
  digitalWrite(11, LOW);
  digitalWrite(10, HIGH);
  delay (3000);
  digitalWrite(10, LOW);
  digitalWrite(9, HIGH);
  delay (3000);
  digitalWrite(9, LOW);
  digitalWrite(8, HIGH);
  delay (3000);
  digitalWrite(8, LOW);
  digitalWrite(7, HIGH);
  delay (3000);
  digitalWrite(7, LOW);
  digitalWrite(6, HIGH);
  delay (3000);
  digitalWrite(6, LOW);
  digitalWrite(5, HIGH);
  delay (3000);
  digitalWrite(5, LOW);
  digitalWrite(4, HIGH);
  delay (3000);
  digitalWrite(4, LOW);
  digitalWrite(3, HIGH);
  delay (3000);
  digitalWrite(3, LOW);
  digitalWrite(2, HIGH); //hold for 10 seconds, playing buzzer and light for TIMES UP, then reset to 13
  delay (10000);
  digitalWrite(2, LOW); //light and buzzer off

}

That's what auto-format makes of your code.

  int analogPin (0);

Why's that still there?

I wonder what all those pin numbers are . . ?

sorry for the delay, wife was in surgery.

Answer for pins and code. The sketch should be that when Analog0 is in the low state (toggle switch) the digital outputs go from 13 to two, with each output having a 250 mils delay, a quick loop over and over like chase lights. If A0 is in HIGH (toggle switch in closed position), but A1 is low (button not pushed) digital 13 (output to led) stays on, and nothing else until button is pushed. When button pushed, 13 goes low, and 12 goes on for 3000 mils, then 11, then 10... until it reaches Digital 2, where it holds for 10 seconds, then should reset back to 13 waiting for button push again.

Does that answer better?

as for the pin numbers, I thought the reference page said to list each pin, so I did. I was not sure how to do one of the library things to make the code simpler...

Also, after more reading, I think I need a debounce. Yes?

 if (digitalRead (A1) == HIGH)
    digitalWrite(13, LOW); //push button activates countdown timer, turning off 13 and working down timer LEDs at 3 seconds each for 30 second game time.
  digitalWrite(12, HIGH);

The formatted code shows that the only line of code that depends on A1 being HIGH is

   digitalWrite(13, LOW); //push button activates countdown timer, turning off 13 and working down timer

All subsequent lines will always be executed. Is that what you intend to happen ?

You should probably cover the basics before getting into and debounce code. In general, you are still working with delays() in your code, and debounce won't do much with those still present.

Delays are fine when you are first getting started and set up. They help you debug, and visually see changes you otherwise couldn't see due to speed.

Only once you move onto other timing methods should you start to consider how debounce helps you out.

ok. The If statement should 1) go from the 250 delay section of the sketch when on A0 is low, to If A0 is high, Digital 13 comes on and holds there until A1 is pushed (second IF statement) at which point the 3000 delay sequence should start, get to digital2 (hold 10 seconds), then back to 13.

also, the int statement was because I thought maybe the reason the IF statements did not work was due to needing to telling the sketch to read the analog input...

kidpreacher5325: On analog A0 I have a toggle switch (with a pull down resistor) and on A1 I have a push button (also with a pull down resistor). When the toggle is in the "LOW" position, my sketch is set to have each row light up every 1/4 second - a display mode.

What? You just want the lights to cycle around and around?

Yes PaulMurry, before the church service starts, I just want the lights to cycle over and over very fast. My kids church room is a circus/carnival theme, so the lights are like on the midway or arcade. When church starts, I flip the toggle switch, which stops the cycle and puts the tower in "game mode" waiting for someone to push the button to start the game timer, and thereby not causing a distraction during the lesson time. At the end of the lesson, while waiting for the parents to come get their children, we will play "Minute to win it" type games, which is what the countdown timer is for. So the toggle on Analog0 is to switch from the over and over fast chase, and the slower 30 second timer. The pushbutton on Analog 2 starts the actual 30 second timer. Anything else?

Thank you all for your help. After reading the comments, plus going back to the reference pages, I was able to make the following sketch work.

void setup() {
  // put your setup code here, to run once:
pinMode (A0, INPUT); //analog input to toggle switch -resistor to ground on return side
pinMode (A1, INPUT); //analog inpu to push button - resistor to ground on return side
pinMode (13, OUTPUT); //LED = Get Ready - all LED outputs have 3 parallel LEDs with resistors.
pinMode (12, OUTPUT); // LED countdown light 10
pinMode (11, OUTPUT); // LED countdown light 9
pinMode (10, OUTPUT); // LED countdown light 8
pinMode (9, OUTPUT); // LED countdown light 7
pinMode (8, OUTPUT); // LED countdown light 6
pinMode (7, OUTPUT); // LED countdown light 5
pinMode (6, OUTPUT); // LED countdown light 4
pinMode (5, OUTPUT); // LED countdown light 3
pinMode (4, OUTPUT); // LED countdown light 2
pinMode (3, OUTPUT); // LED countdown light 1
pinMode (2, OUTPUT); // LED countdown TIMES UP plus buzzer
}

void loop() {
  // put your main code here, to run repeatedly:

if (digitalRead (A0) == HIGH){
digitalWrite(13, HIGH); // toggle switch on countdown mode (high) LED13 is on until push button activates timer.


if (digitalRead (A1) == HIGH){
digitalWrite(13, LOW); //push button activates countdown timer, turning off 13 and working down timer LEDs at 3 seconds each for 30 second game time.
digitalWrite(12, HIGH);
delay (3000);
digitalWrite(12, LOW);
digitalWrite(11, HIGH);
delay (3000);
digitalWrite(11, LOW);
digitalWrite(10, HIGH);
delay (3000);
digitalWrite(10, LOW);
digitalWrite(9, HIGH);
delay (3000);
digitalWrite(9, LOW);
digitalWrite(8, HIGH);
delay (3000);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
delay (3000);
digitalWrite(7, LOW);
digitalWrite(6, HIGH);
delay (3000);
digitalWrite(6, LOW);
digitalWrite(5, HIGH);
delay (3000);
digitalWrite(5, LOW);
digitalWrite(4, HIGH);
delay (3000);
digitalWrite(4, LOW);
digitalWrite(3, HIGH);
delay (3000);
digitalWrite(3, LOW);
digitalWrite(2, HIGH); //hold for 10 seconds, playing buzzer and light for TIMES UP, then reset to 13
delay (10000);
digitalWrite(2, LOW); //light and buzzer off
}
}
if (digitalRead (A0) == LOW){
digitalWrite(13, HIGH); //LED quick loop when toggle is in display (low) mode
delay (250);
digitalWrite(13, LOW); //led13 off
digitalWrite(12, HIGH);//led 12 on
delay (250); //  quarter second delay
digitalWrite(12, LOW);// led 12 off
digitalWrite(11, HIGH);
delay (250);
digitalWrite(11, LOW);
digitalWrite(10, HIGH);
delay (250);
digitalWrite(10, LOW);
digitalWrite(9, HIGH);
delay (250);
digitalWrite(9, LOW);
digitalWrite(8, HIGH);
delay (250);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
delay (250);
digitalWrite(7, LOW);
digitalWrite(6, HIGH);
delay (250);
digitalWrite(6, LOW);
digitalWrite(5, HIGH);
delay (250);
digitalWrite(5, LOW);
digitalWrite(4, HIGH);
delay (250);
digitalWrite(4, LOW);
digitalWrite(3, HIGH);
delay (250);
digitalWrite(3, LOW);
digitalWrite(2, HIGH);
delay (250);
digitalWrite(2, LOW);
delay (250);
}
}

Last and final note. Made final adjustments so that the "demo Mode" loop has 3 lights on at a time doing the chase light thing. This actually shortened the sketch and made it process faster, as well as looks better. Here is the finalized sketch.

void setup() {
  // put your setup code here, to run once:
pinMode (A0, INPUT); //analog input to toggle switch -resistor to ground on return side
pinMode (A1, INPUT); //analog inpu to push button - resistor to ground on return side
pinMode (13, OUTPUT); //LED = Get Ready - all LED outputs have 3 parallel LEDs with resistors.
pinMode (12, OUTPUT); // LED countdown light 10
pinMode (11, OUTPUT); // LED countdown light 9
pinMode (10, OUTPUT); // LED countdown light 8
pinMode (9, OUTPUT); // LED countdown light 7
pinMode (8, OUTPUT); // LED countdown light 6
pinMode (7, OUTPUT); // LED countdown light 5
pinMode (6, OUTPUT); // LED countdown light 4
pinMode (5, OUTPUT); // LED countdown light 3
pinMode (4, OUTPUT); // LED countdown light 2
pinMode (3, OUTPUT); // LED countdown light 1
pinMode (2, OUTPUT); // LED countdown TIMES UP plus buzzer
}

void loop() {
  // put your main code here, to run repeatedly:

if (digitalRead (A0) == HIGH){
digitalWrite(13, HIGH); // toggle switch on countdown mode (high) LED13 is on until push button activates timer.
digitalWrite(10, LOW);
digitalWrite(6, LOW);
digitalWrite(2, LOW);

if (digitalRead (A1) == HIGH){
digitalWrite(13, LOW); //push button activates countdown timer, turning off 13 and working down timer LEDs at 3 seconds each for 30 second game time.
digitalWrite(12, HIGH);
delay (3000);
digitalWrite(12, LOW);
digitalWrite(11, HIGH);
delay (3000);
digitalWrite(11, LOW);
digitalWrite(10, HIGH);
delay (3000);
digitalWrite(10, LOW);
digitalWrite(9, HIGH);
delay (3000);
digitalWrite(9, LOW);
digitalWrite(8, HIGH);
delay (3000);
digitalWrite(8, LOW);
digitalWrite(7, HIGH);
delay (3000);
digitalWrite(7, LOW);
digitalWrite(6, HIGH);
delay (3000);
digitalWrite(6, LOW);
digitalWrite(5, HIGH);
delay (3000);
digitalWrite(5, LOW);
digitalWrite(4, HIGH);
delay (3000);
digitalWrite(4, LOW);
digitalWrite(3, HIGH);
delay (3000);
digitalWrite(3, LOW);
digitalWrite(2, HIGH); //hold for 10 seconds, playing buzzer and light for TIMES UP, then reset to 13
delay (10000);
digitalWrite(2, LOW); //light and buzzer off
}
}
if (digitalRead (A0) == LOW){
digitalWrite(10, LOW);
digitalWrite(6, LOW);
digitalWrite(2, LOW);
digitalWrite(13, HIGH); //LED quick loop when toggle is in display (low) mode
digitalWrite(9, HIGH);
digitalWrite(5, HIGH);
delay (320);
digitalWrite(13, LOW); //led13 off
digitalWrite(9, LOW);
digitalWrite(5, LOW);
digitalWrite(12, HIGH);
digitalWrite(8, HIGH);//led 12 on
digitalWrite(4, HIGH);
delay (320); //  quarter second delay
digitalWrite(12, LOW);// led 12 off
digitalWrite(8, LOW);
digitalWrite(4, LOW);
digitalWrite(11, HIGH);
digitalWrite(7, HIGH);
digitalWrite(3, HIGH);
delay (320);
digitalWrite(11, LOW);
digitalWrite(7, LOW);
digitalWrite(3, LOW);
digitalWrite(10, HIGH);
digitalWrite(6, HIGH);
digitalWrite(2, HIGH);
delay (100);


}
}

Thanks again for all those who helped. Be blessed.

      digitalWrite(13, LOW); //push button activates countdown timer, turning off 13 and working down timer LEDs at 3 seconds each for 30 second game time.
      digitalWrite(12, HIGH);
      delay (3000);
      digitalWrite(12, LOW);
      digitalWrite(11, HIGH);
      delay (3000);
      digitalWrite(11, LOW);
      digitalWrite(10, HIGH);
      delay (3000);
      digitalWrite(10, LOW);
      digitalWrite(9, HIGH);
      delay (3000);
      digitalWrite(9, LOW);
      digitalWrite(8, HIGH);
      delay (3000);
      digitalWrite(8, LOW);
      digitalWrite(7, HIGH);
      delay (3000);
      digitalWrite(7, LOW);
      digitalWrite(6, HIGH);
      delay (3000);
      digitalWrite(6, LOW);
      digitalWrite(5, HIGH);
      delay (3000);
      digitalWrite(5, LOW);
      digitalWrite(4, HIGH);
      delay (3000);
      digitalWrite(4, LOW);
      digitalWrite(3, HIGH);
      delay (3000);
      digitalWrite(3, LOW);
      digitalWrite(2, HIGH); //hold for 10 seconds, playing buzzer and light for TIMES UP, then reset to 13
      delay (10000);
      digitalWrite(2, LOW); //light and buzzer off

Isn't that the same as

for (byte i = 13; i > 2; i--)
{
  digitalWrite (i, LOW);
  digitalWrite (i - 1, HIGH);
  delay (3000);
}
delay (7000);
digitalWrite (2, LOW)