Having an issue with my program for a 3x3x3 led cube

So I am trying to create a semi(appears tor be) randomized flashing led cube and I keep getting the same error code.

alt-led_cube_code.ino (8.73 KB)

Function definitions need to end with a closing brace }

Some of yours don’t. e.g. where does bottomRowPaneFigure1() end?

You can’t start a new function definition before you end the last one.

You’ve repeated this same error a few times.

Well I did copy and paste a few times. But I still can't identify my errors, because I am so new to arduino. So I know I have an error and I just end up banging my head against a wall, trying to figure it out.

Post your code and error message in code tags. </>

M’y original code is attached as an .ino file, in the main post.

Post your code and error message in code tags. </>

<

//Array for three LED levels
int ledRow[] = { 2, 3, 4 };
// Array for nine LED's in each level
int ledCol[] = { 5, 6, 7, 8, 9, 10, 11, 12, 13 };
int timer = 500;

void setup() // Sets up all pins as Output
{
  for ( int i =  0; i < 3; i++)
  {
    pinMode( ledRow[i], OUTPUT);
  }

  {
    for (int j =  0; j < 9; j++)

    {
      pinMode( ledCol[j], OUTPUT);
    }
  }
}
// Sets an LED HIGH based on Row and Column position
void onLED(int ledRow, int ledCol) {

  digitalWrite(ledRow, HIGH);
  digitalWrite(ledCol, HIGH);

}

// Sets an LED LOW based on Row and Column position
void offLED(int ledRow, int ledCol)
{
  digitalWrite(ledRow, LOW);
  digitalWrite(ledCol, LOW);
}

void topRowPaneFigure1()
{
  for (int y = 0; y < 3; y++)  // light LED's 1 - 3 on/off on top level

  {
    onLED(ledRow[0], ledCol[y]);        // 7 8 9
    delay(timer);                       // 4 5 6
    offLED(ledRow[0], ledCol[y]);       // 1 2 3
  }
  for (int y = 5; y > 2; y--) // light LED's 6 - 4 on/off on top level
  {
    onLED(ledRow[0], ledCol[y]);
    delay(timer);
    offLED(ledRow[0], ledCol[y]);
  }
  for (int y = 6; y < 9; y++) // light LED's 7 - 9 on/off on top level
  {
    onLED(ledRow[0], ledCol[y]);
    delay(timer);
    offLED(ledRow[0], ledCol[y]);
  }
  for (int y = 5; y > 2; y--)  // light LED's 6 - 4 on/off on top level
  {
    onLED(ledRow[0], ledCol[y]);
    delay(timer);
    offLED(ledRow[0], ledCol[y]);
  }

}


void centreRowPaneFigure1()
{
  for (int y = 0; y < 3; y++)   // light LED's 1 - 3 on/off on centre level
  {
    onLED(ledRow[1], ledCol[y]);          // 7 8 9
    delay(timer);                         // 4 5 6
    offLED(ledRow[1], ledCol[y]);         // 1 2 3
  }
  for (int y = 5; y > 2; y--)  // light LED's 6 - 4 on/off on centre level
  {
    onLED(ledRow[1], ledCol[y]);
    delay(timer);
    offLED(ledRow[1], ledCol[y]);
  }
  for (int y = 6; y < 9; y++)  // light LED's 7 - 9 on/off on centre level
  {
    onLED(ledRow[1], ledCol[y]);
    delay(timer);
    offLED(ledRow[1], ledCol[y]);
  }
  for (int y = 5; y > 2; y--)  // light LED's 6 - 4 on/off on centre level
  {
    onLED(ledRow[1], ledCol[y]);
    delay(timer);
    offLED(ledRow[1], ledCol[y]);
  }

}

void bottomRowPaneFigure1()
{
for (int y = 0; y < 3; y++)  // light LED's 1 - 3 on/off on bottom level
  {
    onLED(ledRow[2], ledCol[y]);         // 7 8 9
    delay(timer);                        // 4 5 6
    offLED(ledRow[2], ledCol[y]);        // 1 2 3
  }
  for (int y = 5; y > 2; y--)  // light LED's 6 - 4 on/off on bottom level
    onLED(ledRow[2], ledCol[y]);
    delay(timer);
    offLED(ledRow[2], ledCol[y]);
  }
for (int y = 6; y < 9; y++)  // light LED's 7 - 9 on/off on bottom level
    onLED(ledRow[2], ledCol[y]);
    delay(timer);
    offLED(ledRow[2], ledCol[y]);
  }
for (int y = 5; y > 2; y--)   // light LED's 6 - 4 on/off on bottom level
    {
    onLED(ledRow[2], ledCol[y]);
    delay(timer);
    offLED(ledRow[2], ledCol[y]);
    
  }
void topRowPaneFigure2()
{
    for (int y = 0; y < 3; y++)  // light LED's 1 - 3 on/off on top level
    {
      onLED(ledRow[0], ledCol[y]);        // 7 8 9
      delay(timer);                       // 4 5 6
      offLED(ledRow[0], ledCol[y]);       // 1 2 3
    }
    for (int y = 5; y > 2; y--) // light LED's 6 - 4 on/off on top level
      onLED(ledRow[0], ledCol[y]);
      delay(timer);
      offLED(ledRow[0], ledCol[y]);
    }
    for (int y = 6; y < 9; y++) // light LED's 7 - 9 on/off on top level
      onLED(ledRow[0], ledCol[y]);
      delay(timer);
      offLED(ledRow[0], ledCol[y]);
    }
    for (int y = 5; y > 2; y--)  // light LED's 6 - 4 on/off on top level
      onLED(ledRow[0], ledCol[y]);
      delay(timer);
      offLED(ledRow[0], ledCol[y]);
    }

  }


  void centreRowPaneFigure2()
  {
    for (int y = 0; y < 3; y++)}  // light LED's 1 - 3 on/off on centre level
    {
      onLED(ledRow[1], ledCol[y]);          // 7 8 9
      delay(timer);                         // 4 5 6
      offLED(ledRow[1], ledCol[y]);         // 1 2 3
    }
    for (int y = 5; y > 2; y--)  // light LED's 6 - 4 on/off on centre level
      onLED(ledRow[1], ledCol[y]);
      delay(timer);
      offLED(ledRow[1], ledCol[y]);
    }
    for (int y = 6; y < 9; y++)  // light LED's 7 - 9 on/off on centre level
      onLED(ledRow[1], ledCol[y]);
      delay(timer);
      offLED(ledRow[1], ledCol[y]);
    }
    for (int y = 5; y > 2; y--)  // light LED's 6 - 4 on/off on centre level
      onLED(ledRow[1], ledCol[y]);
      delay(timer);
      offLED(ledRow[1], ledCol[y]);
    }

  }

  void bottomRowPaneFigure2()
  {
    for (int y = 0; y < 3; y++)  // light LED's 1 - 3 on/off on bottom level
    {
      onLED(ledRow[2], ledCol[y]);         // 7 8 9
      delay(timer);                        // 4 5 6
      offLED(ledRow[2], ledCol[y]);        // 1 2 3
    }
    for (int y = 5; y > 2; y--)  // light LED's 6 - 4 on/off on bottom level
      onLED(ledRow[2], ledCol[y]);
      delay(timer);
      offLED(ledRow[2], ledCol[y]);
    }
    for (int y = 6; y < 9; y++)  // light LED's 7 - 9 on/off on bottom level
    {
      onLED(ledRow[2], ledCol[y]);
      delay(timer);
      offLED(ledRow[2], ledCol[y]);
    }
    for (int y = 5; y > 2; y--)   // light LED's 6 - 4 on/off on bottom level
    {
      onLED(ledRow[2], ledCol[y]);
      delay(timer);
      offLED(ledRow[2], ledCol[y]);
    }
    void topRowPaneFigure3()
    {
      for (int y = 0; y < 3; y++)  // light LED's 1 - 3 on/off on top level
      {
        onLED(ledRow[0], ledCol[y]);        // 7 8 9
        delay(timer);                       // 4 5 6
        offLED(ledRow[0], ledCol[y]);       // 1 2 3
      }
      for (int y = 5; y > 2; y--) // light LED's 6 - 4 on/off on top level
      {
        onLED(ledRow[0], ledCol[y]);
        delay(timer);
        offLED(ledRow[0], ledCol[y]);
      }
      for (int y = 6; y < 9; y++) // light LED's 7 - 9 on/off on top level
      {
        onLED(ledRow[0], ledCol[y]);
        delay(timer);
        offLED(ledRow[0], ledCol[y]);
      }
      for (int y = 5; y > 2; y--)  // light LED's 6 - 4 on/off on top level
      {
        onLED(ledRow[0], ledCol[y]);
        delay(timer);
        offLED(ledRow[0], ledCol[y]);
      }

    }


    void centreRowPaneFigure3()
    {
      for (int y = 0; y < 3; y++)   // light LED's 1 - 3 on/off on centre level
      {
        onLED(ledRow[1], ledCol[y]);          // 7 8 9
        delay(timer);                         // 4 5 6
        offLED(ledRow[1], ledCol[y]);         // 1 2 3
      }
      for (int y = 5; y > 2; y--)  // light LED's 6 - 4 on/off on centre level
      {
        onLED(ledRow[1], ledCol[y]);
        delay(timer);
        offLED(ledRow[1], ledCol[y]);
      }
      for (int y = 6; y < 9; y++)  // light LED's 7 - 9 on/off on centre level
      {
        onLED(ledRow[1], ledCol[y]);
        delay(timer);
        offLED(ledRow[1], ledCol[y]);
      }
      for (int y = 5; y > 2; y--)  // light LED's 6 - 4 on/off on centre level
      {
        onLED(ledRow[1], ledCol[y]);
        delay(timer);
        offLED(ledRow[1], ledCol[y]);
      }

    }

    void bottomRowPaneFigure3()
    {
      for (int y = 0; y < 3; y++)  // light LED's 1 - 3 on/off on bottom level
      {
        onLED(ledRow[2], ledCol[y]);         // 7 8 9
        delay(timer);                        // 4 5 6
        offLED(ledRow[2], ledCol[y]);        // 1 2 3
      }
      for (int y = 5; y > 2; y--)  // light LED's 6 - 4 on/off on bottom level
      {
        onLED(ledRow[2], ledCol[y]);
        delay(timer);
        offLED(ledRow[2], ledCol[y]);
      }
      for (int y = 6; y < 9; y++)  // light LED's 7 - 9 on/off on bottom level
      {
        onLED(ledRow[2], ledCol[y]);
        delay(timer);
        offLED(ledRow[2], ledCol[y]);
      }
      for (int y = 5; y > 2; y--)   // light LED's 6 - 4 on/off on bottom level
      {
        onLED(ledRow[2], ledCol[y]);
        delay(timer);
        offLED(ledRow[2], ledCol[y]);
      }

    }


    void loop()
    {
      topRowPaneFigure1();
      centreRowPaneFigure2();
      bottomRowPaneFigure1();
      bottomRowPaneFigure2();
      topRowPaneFigure3();
      centreRowPaneFigure1();
      topRowPaneFigure3();
      centreRowPaneFigure1();
      bottomRowPaneFigure2();
      bottomRowPaneFigure3();
      topRowPaneFigure3();
      centreRowPaneFigure2();
      topRowPaneFigure1();
      bottomRowPaneFigure2();
      centreRowPaneFigure1();
      bottomRowPaneFigure2();
      topRowPaneFigure3();
      centreRowPaneFigure1();
    }[/]>

Post your code and error message in code tags.
You make it very difficult to (want to) help you.

Arduino: 1.8.9 Hourly Build 2019/02/04 10:33 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

C:\Users\xxxxxxx laptop\Documents\Arduino\alt-led_cube_code\alt-led_cube_code.ino: In function 'void bottomRowPaneFigure1()':

alt-led_cube_code:127:1: error: a function-definition is not allowed here before '{' token

 {

 ^

alt-led_cube_code:326:5: error: expected '}' at end of input

     }

     ^

exit status 1
a function-definition is not allowed here before '{' token

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Instead of randomly splattering curly braces all over the place, you need to pay attention to where they are needed, where they are optional, and where they are plain silly.

void setup() // Sets up all pins as Output
{ ← required
for ( int i = 0; i < 3; i++)
{ ← optional
pinMode( ledRow[ i ], OUTPUT);
}

{ ← plain silly

Go through your code. Get rid of the plain silly ones. Properly indent your code, and you’ll see where you have an opening brace for a function inside another function. That is NOT allowed.

Well everybody I am proud to say we have success. Y'all were a huge help in troubleshooting the (admittedly pretty stupid simple) errors in my sketch. I have a feeling I will be using this code for a while.
I will post the finished project in the projects forum page' whenever I finish putting the finishing touches on it.

A very helpful troubleshooting tool is the Auto Format feature (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor). If you do an Auto Format and then compare the resulting indentation to your intended program structure, it will quickly point you to where there is a missing or extra brace.

Another useful feature of the Arduino IDE/Arduino Web Editor is that when you place the cursor next to one bracket, it puts a box around the matching bracket. In the Arduino IDE, if the cursor is next to the closing bracket and the opening bracket is off the screen then it will show the opening bracket line in a tool tip after a short delay.