You keep messing your self up in pointers..
your function..
C:
void gsm_send(unsigned int ch3) {......}
Your declaration specifies an int
C:
void gsm_send(unsigned int ch3)
{
data_send(ch);
//data_res();
Delay_ms(100);
data_send(ch1);
Delay_ms(100);
//data_res();
data_send(ch2);
Delay_ms(100);
//data_res();
data_send(a);
data_send(ch9);
data_send(a);
data_send("\r\n");
Delay_ms(100);
num(ch3);
Delay_ms(100);
SBUF=0x1a;
while(TI==0);
TI=0;
}
Now data_send wants a pointer!!!! that means you need an array... You need to convert an int to an ascii array.
You have tried with a function " data_res"..
Un fortunately your compiler ( I'm assuming C51) doesn't have the atoi() function... Try this
C:
data_send(itoa(gsm_val));
unsigned char* itoa( unsigned int numb) // My crass interpretation on itoa()..
{
char res[6]; // result
char *tr = &res[5]; // traverse backwards
*tr-- = 0; // null
while((numb/=10) >0)
{
*tr-- = numb%10 + 48;
}
return ++tr;
}
Now you don't need send_gsm()....