problem with array and void functions

Hi I am quite new to arduino and I´m trying to make a 4 digit 7 segment countdown timer and I cannot get that array to work as you can see in the code. So what can I do to make it work?

int A = 6;
int B = 7;
int C = 8;
int D = 9;
int E = 10;
int FF = 11;
int G = 12;



void one()
{
  digitalWrite(D, 1);
  digitalWrite(E, 0);
  digitalWrite(FF, 0);
  digitalWrite(G, 1);
  digitalWrite(A, 1);
  digitalWrite(B, 1);
  digitalWrite(C, 1);
  
}

void two()
{
  digitalWrite(D, 0);
  digitalWrite(E, 0);
  digitalWrite(FF, 1);
  digitalWrite(G, 0);
  digitalWrite(A, 0);
  digitalWrite(B, 0);
  digitalWrite(C, 1);
  
}

void three()
{
  digitalWrite(D, 0);
  digitalWrite(E, 1);
  digitalWrite(FF, 1);
  digitalWrite(G, 0);
  digitalWrite(A, 0);
  digitalWrite(B, 0);
  digitalWrite(C, 0);
  
}

void four()
{
  digitalWrite(D, 1);
  digitalWrite(E, 1);
  digitalWrite(FF, 0);
  digitalWrite(G, 0);
  digitalWrite(A, 1);
  digitalWrite(B, 0);
  digitalWrite(C, 0);
  
}

void five()
{
  digitalWrite(D, 0);
  digitalWrite(E, 1);
  digitalWrite(FF, 0);
  digitalWrite(G, 0);
  digitalWrite(A, 0);
  digitalWrite(B, 1);
  digitalWrite(C, 0);
  
}

void six()
{
  digitalWrite(D, 0);
  digitalWrite(E, 0);
  digitalWrite(FF, 0);
  digitalWrite(G, 0);
  digitalWrite(A, 0);
  digitalWrite(B, 1);
  digitalWrite(C, 0);
  
}

void seven()
{
  digitalWrite(D, 1);
  digitalWrite(E, 1);
  digitalWrite(FF, 1);
  digitalWrite(G, 1);
  digitalWrite(A, 0);
  digitalWrite(B, 0);
  digitalWrite(C, 0);
  
}

void eight()
{
  digitalWrite(D, 0);
  digitalWrite(E, 0);
  digitalWrite(FF, 0);
  digitalWrite(G, 0);
  digitalWrite(A, 0);
  digitalWrite(B, 0);
  digitalWrite(C, 0);
  
}

void nine()
{
  digitalWrite(D, 0);
  digitalWrite(E, 1);
  digitalWrite(FF, 0);
  digitalWrite(G, 0);
  digitalWrite(A, 0);
  digitalWrite(B, 0);
  digitalWrite(C, 0);
  
}

void zero()
{
  digitalWrite(D, 0);
  digitalWrite(E, 0);
  digitalWrite(FF, 0);
  digitalWrite(G, 1);
  digitalWrite(A, 0);
  digitalWrite(B, 0);
  digitalWrite(C, 0);
  
}

  int stevilke[] = {
  zero, one, two, three, four, five, six, seven, eight, nine };
  
  void setup()
  {
    
    
  }
  
  void loop()
  {
    
    
  }

Never build a ladder when you can stand on the shoulders of others:

http://playground.arduino.cc/Main/LedControl

The compile errors don't tell you anything?

error: invalid conversion from 'void (*)()' to 'int'

You made an int array in SRAM and you are trying to fill it with function pointers.

something like this:

int A = 6;
int B = 7;
int C = 8;
int D = 9;
int E = 10;
int FF = 11;
int G = 12;



void one()
{
  digitalWrite(D, 1);
  digitalWrite(E, 0);
  digitalWrite(FF, 0);
  digitalWrite(G, 1);
  digitalWrite(A, 1);
  digitalWrite(B, 1);
  digitalWrite(C, 1);

}

void two()
{
  digitalWrite(D, 0);
  digitalWrite(E, 0);
  digitalWrite(FF, 1);
  digitalWrite(G, 0);
  digitalWrite(A, 0);
  digitalWrite(B, 0);
  digitalWrite(C, 1);

}

void three()
{
  digitalWrite(D, 0);
  digitalWrite(E, 1);
  digitalWrite(FF, 1);
  digitalWrite(G, 0);
  digitalWrite(A, 0);
  digitalWrite(B, 0);
  digitalWrite(C, 0);

}

void four()
{
  digitalWrite(D, 1);
  digitalWrite(E, 1);
  digitalWrite(FF, 0);
  digitalWrite(G, 0);
  digitalWrite(A, 1);
  digitalWrite(B, 0);
  digitalWrite(C, 0);

}

void five()
{
  digitalWrite(D, 0);
  digitalWrite(E, 1);
  digitalWrite(FF, 0);
  digitalWrite(G, 0);
  digitalWrite(A, 0);
  digitalWrite(B, 1);
  digitalWrite(C, 0);

}

void six()
{
  digitalWrite(D, 0);
  digitalWrite(E, 0);
  digitalWrite(FF, 0);
  digitalWrite(G, 0);
  digitalWrite(A, 0);
  digitalWrite(B, 1);
  digitalWrite(C, 0);

}

void seven()
{
  digitalWrite(D, 1);
  digitalWrite(E, 1);
  digitalWrite(FF, 1);
  digitalWrite(G, 1);
  digitalWrite(A, 0);
  digitalWrite(B, 0);
  digitalWrite(C, 0);

}

void eight()
{
  digitalWrite(D, 0);
  digitalWrite(E, 0);
  digitalWrite(FF, 0);
  digitalWrite(G, 0);
  digitalWrite(A, 0);
  digitalWrite(B, 0);
  digitalWrite(C, 0);

}

void nine()
{
  digitalWrite(D, 0);
  digitalWrite(E, 1);
  digitalWrite(FF, 0);
  digitalWrite(G, 0);
  digitalWrite(A, 0);
  digitalWrite(B, 0);
  digitalWrite(C, 0);

}

void zero()
{
  digitalWrite(D, 0);
  digitalWrite(E, 0);
  digitalWrite(FF, 0);
  digitalWrite(G, 1);
  digitalWrite(A, 0);
  digitalWrite(B, 0);
  digitalWrite(C, 0);

}

void (*stevilke[10])()= {zero, one, two, three, four, five, six, seven, eight, nine};

void setup()
{
  //setup the pins to output
}

void loop()
{
  for (int i = 0; i < 10; i++)
  {
    stevilke[9-i]();
    delay(1000);
  }
}

@BulldogLowell: I'm in FL away from my development machine so I can't check things out, but your code looks like it should work and count down from 9. I'm not sure that the code from the OP works and that the segments are defined correctly. Given your code, I'm assuming they are correct.

However, that being said, why would you use and array of pointers to function with a newbie when an existing library will likely do what he needs? All new programmers can save themselves a ton of time if they read and use the library code that's available to them. The examples that are normally distributed with the library are a great way for a newbie to learn how to use the library code, plus expose them to (normally) good coding techniques.

I've read enough of your posts to know you know what you're doing and that your posts are always helpful. I just wonder what your reason was for the nature of this post.

You learn more rolling your own or at least learning from code rather than just including it.

econjack:
@BulldogLowell: I'm in FL away from my development machine so I can't check things out, but your code looks like it should work and count down from 9. I'm not sure that the code from the OP works and that the segments are defined correctly. Given your code, I'm assuming they are correct.

However, that being said, why would you use and array of pointers to function with a newbie when an existing library will likely do what he needs? All new programmers can save themselves a ton of time if they read and use the library code that's available to them. The examples that are normally distributed with the library are a great way for a newbie to learn how to use the library code, plus expose them to (normally) good coding techniques.

I've read enough of your posts to know you know what you're doing and that your posts are always helpful. I just wonder what your reason was for the nature of this post.

Looking at what he was doing, I just thought he was trying to create an array of pointers, but just made a syntax error with the array.

Personally, I prefer the bitRead function and an array of bit masks, sometimes I show people that method because it (once you understand it) it is really simple. I actually haven't used a library to do this :-[ but you make a good point about making it easy to just use a library. To GoForSmoke's point, actually learning to program this problem is a good thing too.

Agree... I am not sure he's lighting the segments correctly, but he will probably see that once he compiles and loads the program.

I wasn't sure if the sketch is just a way to experiment with function pointers.

Personally if I just wanted to make the 7-seg display work I would have put the pin numbers in a PROGMEM byte array and then make a PROGMEM array to hold 1 byte per display number with the bits storing 7 OFF/ON states each and only have one function to write the states to the pins but that would not demonstrate anything about function pointers.