program won't upload to arduino

I’m working on a school project, I’m trying to create a smart house program with a limited components, For example I do not have a switched so I tried to make the buttons act like a switches.

The problem is the program won’t upload to arduino but compiles fine. It’s also doesn’t gives me any error, It’s just says that the program was not uploaded, But any other program is uploading with no problems. So my question is what i’ve done wrong in the code? Thanks in Advance.

#define btnNum 0
#define btnState 1
#define ledNum 2

int AA [][4] = // setting up a values
{
  { 2, 0, 8 },
  { 3, 0, 9 },
  { 4, 0, 10 },
  { 5, 0, 11 },
  { 6, 0, 12 }
};
/*
String RoomNames[5] =
{
  "btnLivingRoom",
  "btnBathRoom",
  "btnBedRoom",
  "btnKitchen",
  "btnParking"
};
*/
int Counter;

void setup() {
  for(int i; i < sizeof(AA); i++)
  {
    pinMode(AA[i][btnNum], INPUT_PULLUP); // setting up the inputs according to AA
    pinMode(AA[i][ledNum], OUTPUT); // setting up the outputs according to AA
  }
}

void loop() {
  for(int i; i < sizeof(AA); i++) // running 5 times for each led
  {
    if (digitalRead(AA[i][btnNum]) == HIGH) // checking if the button is pressed
    {
      while(Counter < 1) // to make the function run only once for a press
      {
        if (AA[i][btnState] = 0)
          AA[i][btnState] = 1;
        else
          AA[i][btnState] = 0;

        Counter ++;
      }
    }
    else
      Counter = 0; // enable function again

    if (AA[i][btnState] == 1) // turn ON/OFF the led depending on btnState
      digitalWrite(AA[i][ledNum], HIGH);
    else
      digitalWrite(AA[i][ledNum], LOW);
  }
}
  for(int i; i < sizeof(AA); i++)

You do NOT want to iterate the same number of times as there are bytes in the 2D array!

Figure out the PROPER number of times to iterate.

      while(Counter < 1) // to make the function run only once for a press
      {
        if (AA[i][btnState] = 0)
          AA[i][btnState] = 1;
        else
          AA[i][btnState] = 0;

        Counter ++;
      }

The comment is a load of horse poop. Using a while statement to cause the code to execute once is silly. The while loop contributes NOTHING.

It compiles and uploads for me. Just triggers a pile of warnings, some of which point to real errors. You should set warning to “ALL” in Preferences and look at each of them to see if maybe you made some mistakes.

If you are still getting the “not uploaded” error it would help if you could copy and post the text at the bottom of the sketch window, like this:

/var/folders/cs/p6yz0z1m8xj9lf0059b_lzw00000gn/T/arduino_modified_sketch_7872/sketch_dec29c.ino: In function 'void setup()':
/var/folders/cs/p6yz0z1m8xj9lf0059b_lzw00000gn/T/arduino_modified_sketch_7872/sketch_dec29c.ino:28:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i; i < sizeof(AA); i++)
                 ^
/var/folders/cs/p6yz0z1m8xj9lf0059b_lzw00000gn/T/arduino_modified_sketch_7872/sketch_dec29c.ino: In function 'void loop()':
/var/folders/cs/p6yz0z1m8xj9lf0059b_lzw00000gn/T/arduino_modified_sketch_7872/sketch_dec29c.ino:36:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i; i < sizeof(AA); i++) // running 5 times for each led
                 ^
/var/folders/cs/p6yz0z1m8xj9lf0059b_lzw00000gn/T/arduino_modified_sketch_7872/sketch_dec29c.ino:42:32: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
         if (AA[i][btnState] = 0)
                                ^
/Users/john/Library/Arduino15/packages/arduino/hardware/avr/1.6.15/cores/arduino/main.cpp: In function 'main':
/var/folders/cs/p6yz0z1m8xj9lf0059b_lzw00000gn/T/arduino_modified_sketch_7872/sketch_dec29c.ino:28:12: warning: 'i' is used uninitialized in this function [-Wuninitialized]
   for (int i; i < sizeof(AA); i++)
            ^
/var/folders/cs/p6yz0z1m8xj9lf0059b_lzw00000gn/T/arduino_modified_sketch_7872/sketch_dec29c.ino:36:12: warning: 'i' is used uninitialized in this function [-Wuninitialized]
   for (int i; i < sizeof(AA); i++) // running 5 times for each led
            ^

Sketch uses 1,104 bytes (3%) of program storage space. Maximum is 32,256 bytes.
Global variables use 51 bytes (2%) of dynamic memory, leaving 1,997 bytes for local variables. Maximum is 2,048 bytes.