UNO LED light sensor

    resArray[i] = analogRead(A0);

Did you put all your code.
For me A0 is not declared and it returns an error at compile time.