How to made a function to call other functions?
- March 4, 2022
- 17 replies
- 5299 views
Hi to all!!!
I do repeteadly this function:
switch(segundero_d)
{
case 0: numero_0(); break;
case 1: numero_1(); break;
case 2: numero_2(); break;
case 3: numero_3(); break;
case 4: numero_4(); break;
case 5: numero_5(); break;
case 6: numero_6(); break;
case 7: numero_7(); break;
case 8: numero_8(); break;
case 9: numero_9(); break;
}
switch(segundero)
{
case 0: numero_0(); break;
case 1: numero_1(); break;
case 2: numero_2(); break;
case 3: numero_3(); break;
case 4: numero_4(); break;
case 5: numero_5(); break;
case 6: numero_6(); break;
case 7: numero_7(); break;
case 8: numero_8(); break;
case 9: numero_9(); break;
}
...
where the function numero_x are:
void numero_0(void)
{l=m;
fb[l][n]=0x3E; //b"00111110";
fb[l+1][n]=0x22; //b"00100010";
fb[l+2][n]=0x22; //b"00100010";
fb[l+3][n]=0x22; //b"00100010";
fb[l+4][n]=0x3E; //b"00111110";
n++;}
void numero_1(void)
{l=m;
fb[l][n]=0x08; //b"00001000";
fb[l+1][n]=0x18; //b"00011000";
fb[l+2][n]=0x08; //b"00001000";
fb[l+3][n]=0x08; //b"00001000";
fb[l+4][n]=0x3E; //b"00111110";
n++;}
...
And i want to do this, with a function, to call the functions numero_x, to reduce my code, can somebody help me?
Thanx in advice!!!
EDIT: I added a pic, to show, that my code works, but my objetive, is to pulish the code, =)
