Hayee
Member level 3
![Member level 3](/styles/images/ranks/dlevel3.gif)
Hello guys
I want to do something like this but I think I am not doing it properly.
Will you guys correct me how to do that.
Actually this is a simple routine but it will ease my further routine which will write.
I want to do something like this but I think I am not doing it properly.
Will you guys correct me how to do that.
Actually this is a simple routine but it will ease my further routine which will write.
Code:
char A1[] = "12345";
char A2[] = "ABCDE";
char B1[] = "67890";
char B2[] = "FGHIJ";
char C1[] = "13579";
char C2[] = "KLMNO";
unsigned char *Data[6] ={A1,A2,B1,B2,C1,C2};
unsigned int index = 0;
void print_routine(char *ptr)
{
//printf("index = %u\r\n",index);
printf("%S\r\n",*ptr);
}
void main()
{
while(TRUE)
{
print_routine(Data[index]);
delay_ms(1000);
if(index >= 6) index = 0;
else index++;
}
}