Microcontroller › AVR › problem with program of ATmega16 for sms based device control › hi shashank.i think you moved
hi shashank.
i think you moved from your previous thread to hear.
any how.
the function prototype for compr_strng() function your wrote is
void compr_strng();
however your function defination is
/**********************************************/
int compr_strng() // Function to string comparison.
{
char on[10],off[10], msg[10], result,fresult;
result = compare_string1(on, msg);
if(result==0)
{
fresult=1;
return fresult;
}
result = compare_string2(off,msg);
if ( result == 0 )
{
fresult=0;
return fresult;
}
/************************************************/
“void” and “int” return type.
i went through code and found you are using multiple function for string comparision compare_string1 and compare_string2 (also finction prototype for these function is not defined), i don’t know for what reason you are doing so. both functions looks similar. i don’t think you wrote this code.
in function main you are calling undefined function uart_init. may be u miss typed it.(usart_init()).
you are passing pointer to string to function usart_putch() which accepts single charecter. so bascically you are passing address which then turns character (maps between 0 to 255).
i think first you need to study on some terminal how formatted data is received from GSM modem.