veerubiji
Full Member level 2
- Joined
- Feb 24, 2011
- Messages
- 122
- Helped
- 3
- Reputation
- 6
- Reaction score
- 3
- Trophy points
- 1,298
- Activity points
- 2,301
Don't use a string array. Use seperate array for each string (Command). Compare each command of ATMega32 with the command that comes through usart.
Thanks for the reply,
I understand the concept that you are suggesting but what i didn't understand in my code is in which variable i have the incoming command. This was written by someone not by me and i am trying to edit it.
By debugging my code i understand that "&Compare" have the incoming command, because in my code this line
Code:
printf("@%s\r\n",&Compare); //Ack command
I can compare that like as you suggested but i am not sure how to send that to usart.
because i have written usart for sending character if i use
Code:
Uart_putchar(Compare);
Code:
uart_puts(Compare);
function is like this
void uart_puts(const char *s)
{
while(*s)
{
uart_putchar(*s++);
// printf("*");
}
}
This code was written by an experienced person and i have recently joined in place of him and i am learning the ropes of programming. Can you help me with this.