varunme
Advanced Member level 3
- Joined
- Aug 10, 2011
- Messages
- 741
- Helped
- 17
- Reputation
- 36
- Reaction score
- 17
- Trophy points
- 1,318
- Activity points
- 5,765
Can we program like this, is there any otherway to achive this ?
The strings "ONE", "TWO", "THREE" are just examples here , i want to send dynamic text calculated from a loop
i want to know an alternative of switch case, as i think it will reduce the size of the program
Code:
int u;
void dext[1] ()
{
UART1_Write_Text("One"); // send text string to UART
}
void dext[2] ()
{
UART1_Write_Text("Two"); // send text string to UART
}
void dext[3] ()
{
UART1_Write_Text("Three"); // send text string to UART
}
void main()
{
for(u=1;u<=10;u++)
{
dext[u] ();
}
}
The strings "ONE", "TWO", "THREE" are just examples here , i want to send dynamic text calculated from a loop
i want to know an alternative of switch case, as i think it will reduce the size of the program
Last edited: