Question on a 4x4x4 led cube?

Hello I'm wondering if someone can help me out i want to build a led cube i found many tut on youtube d i made one all ready and everything works but my problem is i just want to power up one led at a time sense the anodes are on the digital pins and the cathodes are connected to the analog pins I'm not sure how to write a sketch to power up one led at a time can someone please help me a sketch is below of how the led cube works but i didn't write it. i can't post the whole sketch because to long

/*
 
  Connect:
  column a1-13
  " a2-12
  " a3-11
  " a4-10
  " b1-9
  " b2-8
  " b3-7
  " b4-6
  " c1-5
  " c2-4
  " c3-3
  " c4-2
  " d1-1
  " d2-0
  " d3-A5
  " d4-A4
  layer 4-A3
  layer 3-A2
  layer 2-A1
  layer 1-A0
*/

int layer[4]={A3,A2,A1,A0};

int led[16]={13,12,11,10,9,8,7,6,5,4,3,2,1,0,A5,A4};

 int time = 250;
 
 void setup()
{
  //setting leds to ouput
  for(int i = 0; i<16; i++)
  {
    pinMode(led[i], OUTPUT);
  }
  //setting layers to output
  for(int i = 0; i<4; i++)
  {
    pinMode(layer[i], OUTPUT);
  }
  //seeding random for random animations
  randomSeed(analogRead(10));
}
//+++++++++++++++++++MAIN FUNCTION+++++++++++++++++++++++++++++++++++++


void loop()
{
  turnEverythingOff();//turn all off
  flickerOn();
  turnEverythingOn();//turn all on
  delay(time);
  turnOnAndOffAllByLayerUpAndDownNotTimed();
  layerstompUpAndDown();
  turnOnAndOffAllByColumnSideways();
  delay(time);
  aroundEdgeDown();
  turnEverythingOff();
  randomflicker();
  randomRain();
  diagonalRectangle();
  goThroughAllLedsOneAtATime();
  propeller();
  spiralInAndOut();
  flickerOff();
  turnEverythingOff();
  delay(2000);
}


//++++++++++++++++++++FUNCTIONS++++++++++++++++++++++++++++++++++++++++


//turn all off
void turnEverythingOff()
 {
   for(int i = 0; i<16; i++)
   {
     digitalWrite(led[i], 1);
   }
   for(int i = 0; i<4; i++)
   {
     digitalWrite(layer[i], 0);
   }
 }
 
//turn all on
void turnEverythingOn()
{
  for(int i = 0; i<16; i++)
  {
    digitalWrite(led[i], 0);
  }
  //turning on layers
  for(int i = 0; i<4; i++)
  {
    digitalWrite(layer[i], 1);
  }
}
//turn columns off
void turnColumnsOff()
{
  for(int i = 0; i<16; i++)
  {
    digitalWrite(led[i], 1);
  }
}
//flicker on
void flickerOn()
{
  int i = 150;
  while(i != 0)
  {
    turnEverythingOn();
    delay(i);
    turnEverythingOff();
    delay(i);
    i-= 5;
  }
}
// turn everything on and off by layer up and down NOT TIMED
void turnOnAndOffAllByLayerUpAndDownNotTimed()
{
  int x = 75;
  for(int i = 5; i != 0; i--)
  {
    turnEverythingOn();
    for(int i = 4; i!=0; i--)
    {
      digitalWrite(layer[i-1], 0);
      delay(x);
    }
    for(int i = 0; i<4; i++)
    {
      digitalWrite(layer[i], 1);
      delay(x);
    }
      for(int i = 0; i<4; i++)
    {
      digitalWrite(layer[i], 0);
      delay(x);
    }
    for(int i = 4; i!=0; i--)
    {
      digitalWrite(layer[i-1], 1);
      delay(x);
    }
  }
}
//turn everything on and off by column sideways
void turnOnAndOffAllByColumnSideways()
{
  int x = 75;
  turnEverythingOff();
  //turn on layers
  for(int i = 0; i<4; i++)
  {
    digitalWrite(layer[i], 1);
  }
  for(int y = 0; y<3; y++)
  {
    //turn on 0-3
    for(int i = 0; i<4; i++)
    {
      digitalWrite(led[i], 0);
      delay(x);
    }
    //turn on 4-7
    for(int i = 4; i<8; i++)
    {
      digitalWrite(led[i], 0);
      delay(x);
    }
    //turn on 8-11
    for(int i = 8; i<12; i++)
    {
      digitalWrite(led[i], 0);
      delay(x);
    }
    //turn on 12-15
    for(int i = 12; i<16; i++)
    {
      digitalWrite(led[i], 0);
      delay(x);
    }
    //turn off 0-3
    for(int i = 0; i<4; i++)
    {
      digitalWrite(led[i], 1);
      delay(x);
    }
    //turn off 4-7
    for(int i = 4; i<8; i++)
    {
      digitalWrite(led[i], 1);
      delay(x);
    }
    //turn off 8-11
    for(int i = 8; i<12; i++)
    {
      digitalWrite(led[i], 1);
      delay(x);
    }
    //turn off 12-15
    for(int i = 12; i<16; i++)
    {
      digitalWrite(led[i], 1);
      delay(x);
    }
    //turn on 12-15
    for(int i = 12; i<16; i++)
    {
      digitalWrite(led[i], 0);
      delay(x);
    }
    //turn on 8-11
    for(int i = 8; i<12; i++)
    {
      digitalWrite(led[i], 0);
      delay(x);
    }
    //turn on 4-7
    for(int i = 4; i<8; i++)
    {
      digitalWrite(led[i], 0);
      delay(x);
    }
    //turn on 0-3
    for(int i = 0; i<4; i++)
    {
      digitalWrite(led[i], 0);
      delay(x);
    }
    //turn off 12-15
    for(int i = 12; i<16; i++)
    {
      digitalWrite(led[i], 1);
      delay(x);
    }
    //turn off 8-11
    for(int i = 8; i<12; i++)
    {
      digitalWrite(led[i], 1);
      delay(x);
    }
    //turn off 4-7
    for(int i = 4; i<8; i++)
    {
      digitalWrite(led[i], 1);
      delay(x);
    }
    //turn off 0-3
    for(int i = 0; i<4; i++)
    {
      digitalWrite(led[i], 1);
      delay(x);
    }
  }
}
//up and down single layer stomp
void layerstompUpAndDown()
{
  int x = 75;
  for(int i = 0; i<4; i++)
  {
    digitalWrite(layer[i], 0);
  }
  for(int y = 0; y<5; y++)
  {
    for(int count = 0; count<1; count++)
    { 
      for(int i = 0; i<4; i++)
      {
        digitalWrite(layer[i], 1);
        delay(x);
        digitalWrite(layer[i], 0);
      }
      for(int i = 4; i !=0; i--)
      {
        digitalWrite(layer[i-1], 1);
        delay(x);
        digitalWrite(layer[i-1], 0);
      }
    }
    for(int i = 0; i<4; i++)
    {
      digitalWrite(layer[i], 1);
      delay(x);
    }
    for(int i = 4; i!=0; i--)
    {
      digitalWrite(layer[i-1], 0);
      delay(x);
    }
  }
}
//flicker off
void flickerOff()
{
  turnEverythingOn();
  for(int i = 0; i!= 150; i+=5)
  {
    turnEverythingOff();
    delay(i+50);
    turnEverythingOn();
    delay(i);
  }
}
}

I try to write a sketch like this

int led = A1;
int led2 = A2;


void setup() {                


  pinMode(led, OUTPUT);   
  pinMode(led2, OUTPUT);  
}


void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
 
 digitalWrite(led2, LOW);    // turn the LED off by making the voltage LOW
 
}

i was able to turn one on at a time but i get one other Led the very first one come on as well very dim

Make sure all the pins you are not using are not enabled in any way.

for (int pin = ? ; pin < ?? ; pin++)
{
  pinMode (pin, INPUT) ;
  digitalWrite (pin, LOW) ; // turn off internal pull-up resistor!
}
// now can enable and drive just the pins you want.

A dim glow could be an indication some pins have their pull-ups enabled
which would allow a few 100uA to flow.

In particular if you have an output pin driving HIGH and simple set its pinMode to
INPUT it will have the pull-up enabled as you neglected to pull it LOW.

oh i didn't think about that thank you.

You mention that the cathodes are connected to the analog pins so I assume that all your layers are tied together. The code you posted seems to be for layers that have their anodes tied together (although as you mention you weren't able to post the whole code I could be wrong).

I have assumed that the wiring you describe is correct (layers / cathodes to analog pins) and have written the following. The setup is a modified version of the one you posted, but the loop is new and should turn on just 1 led at a time as you wanted.

If it doesn't work as expected the first thing to try is swapping the HIGH and LOW calls

/*
 
  Connect:
  column a1-13
  " a2-12
  " a3-11
  " a4-10
  " b1-9
  " b2-8
  " b3-7
  " b4-6
  " c1-5
  " c2-4
  " c3-3
  " c4-2
  " d1-1
  " d2-0
  " d3-A5
  " d4-A4
  layer 4-A3
  layer 3-A2
  layer 2-A1
  layer 1-A0
*/

int layer[4]={A3,A2,A1,A0};

int led[16]={13,12,11,10,9,8,7,6,5,4,3,2,1,0,A5,A4};

int time = 500;
 
void setup()
{
  //setting leds to ouput
  for(int i = 0; i<16; i++)
  {
    pinMode(led[i], OUTPUT);
    digitalWrite(led[i], LOW); // turns each LED off
  }
  //setting layers to output
  for(int i = 0; i<4; i++)
  {
    pinMode(layer[i], OUTPUT);
    digitalWrite(layer[i], HIGH); // turns the layers off
  }
}

void loop() {
  // Turn on layers one at a time
  for (int i=0; i<4; i++) {
    digitalWrite(layer[i], LOW); // cathode needs to be LOW to be on
    // now turn on and off each led in sequence
    for (int j=0; j<16; j++) {
      digitalWrite(led[j], HIGH); // LED on
      delay(time); // delay to see the LED
      digitalWrite(led[j], LOW); // LED off
    }
    digitalWrite(layer[i], HIGH);// turn layer off
  }
  delay(1000); // 1 second delay after all LEDs have been lit before
  // restarting the process
}