tinumanikuttan
Newbie level 2

I am trying to transmit an integer by converting it to ascii. I am getting no output when I send it. can someone tell me where i am wrong.? My code :
- - - Updated - - -
I am using PIC16F877a and Hi-Tech C
Code:
void main()
{
inUART();
int n = 123;
char a[10];
inttostring(a,n);
senddata(a);
}
void inttostring(char a[],int num)
{
int i,rem,len=0,n;
n=num;
while(n!=0){
len++;
n=n/10;
}
for(i=0;i<len;i++){
rem = num%10;
num = num/10;
a[len-(i+1)] = rem+'0';
}
a[len] = '\0';
}
void senddata(char buf[])
{
int i;
for(i=0;buf[i]!='\0';i++)
sendsing(buf[i]);
}
void sendsing(char sing)
{
while(!TRMT);
TXREG = sing;
}
- - - Updated - - -
I am using PIC16F877a and Hi-Tech C