I want to transmit three values through uart_putS function. but since the variable that i am passing are char and int type it is showing error as "char" is incompatible with parameter type"char *".
what should i do so that the values that are read and stored in char(int) variable can be transmitted in string format or can be transmitted using uart.
All I see is random garbled garbage.
Did you notice the posting instructions for source code?
#include<lpc214x.h> #include<stdio.h> #include<string.h> #include "UART.h" #define PRESET 0x00210600 #define ESC 0x1B #define DONE 0x80000000 #define START 0x01000000 #define buzzer 16 #define crash 24 void gsm( void); void gps(void); char msg[] ; //msg char msg1[] ; //msg1 unsigned char val1,val2,val3,val4; unsigned int val5=0 , val0 ; unsigned int continuation=0; unsigned int k = 0; unsigned char Key, Gate; unsigned char Buff[50]; char Latt[16]; char Long[16]; unsigned char IE=0; unsigned char Flag,Q,ii,pos,j; unsigned char temp(void); unsigned char memx(void); unsigned char memy(void); unsigned char memz(void); unsigned char vibrate(void); unsigned char brakeapplied(void); void DelayMs(int); void delay(int); void serial_isr (void)__irq; int main(void) { char tem,hor,ver,vib,brake; unsigned int ADC_CH; unsigned long val[5]; PINSEL0 |= 0x00000005; PINSEL1 |= 0x01 << 24; PINSEL1 |= 0x01 << 26; PINSEL1 |= 0x01 << 28; PINSEL1 |= 0x01 << 18; PINSEL0 |= 0x00000003 ; PINSEL0 |= 0x00000003; VPBDIV = 0x02; AD0CR = 0x00210602; AD0CR |= 0x01000000; UART0_Init (9600); U0IER = 1; VICIntSelect = 0<<6; VICVectCntl0 = 0x020 | 6; VICVectAddr0 = (unsigned long)serial_isr; VICIntEnable = 0x00000040; IODIR1=0x00ff0000; ADC_CH = 1; while(1) { while (ADC_CH < 7) { do { val[ADC_CH] = AD0GDR; } while ((val[ADC_CH] & 0x80000000) == 0); val[ADC_CH] = ((val[ADC_CH] >> 6) & 0x03FF); ADC_CH++; delay(10); AD0CR = PRESET | (1<<ADC_CH); AD0CR |= START; } tem= temp(); hor= memx(); ver= memy(); vib= vibrate(); brake= brakeapplied(); if ((IOPIN1 & (1 << 24)) == 0 ) { gps(); gsm(); while ((IOPIN1 & (1<<24)) == 0); } } } unsigned char temp() { U0THR = (AD0DR1 >> 6) & 0x03FF; val0 = U0THR; delay(10); return(val0); } unsigned char memx() { U0THR = (AD0DR2 >> 6) & 0x03FF; delay(5); val1 = U0THR; delay(10); return(val1); } unsigned char memy() { U0THR = (AD0DR3 >> 6) & 0x03FF; delay(5); val2 = U0THR; delay(10); return(val2); } unsigned char memz() { U0THR = (AD0DR4 >> 6) & 0x03FF; delay(5); val3 = U0THR; delay(10); return(val3); } unsigned char vibrate() { U0THR = (AD0DR5 >> 6) & 0x03FF; delay(5); val4 = U0THR; delay(10); return(val4); } void gsm( void) { U0IER = 0; UART1_PutS ("AT+CMGS=\"9176235634\"\r"); delay(10); UART1_PutS ("Vechicle Crashed @ \n Lattitude,Longitude,Temperature,xf,yf,brake : "); delay(10); UART1_PutS (Latt); delay(10); UART1_PutS (Long); delay(10); UART1_PutC (0x1A); delay(10); U0IER = 1; } void gps() { if (Flag == 2) { if (Key == 'A' || Key == 'L') { Flag = 1; } else { Flag = 0; } } if ((Key == 'G' || Key == 'L') && Q == 0) { Flag = 2; } if (Flag == 1) { Q = 1; Gate = 0; Buff[ii] = Key; while (!Gate); ii++; if (ii > 35)//(*(Buff+i) == '*') { IE = 1; U0IER = 0; Q = 0; Flag = 0; pos = 13; j = 0; while (j<10) { Latt[j] = Buff[pos]; pos++; j++; } Latt[j] = '\0'; pos = 25; j=0; while (j < 10) { Long[j] = Buff[pos]; pos++; j++; } Long[j] = '\0'; strcpy (msg, "Lat: "); strcpy (msg1,"Lon: "); j = 0; while (j<10) { msg[j+5] = Latt[j]; msg1[j+5] = Long[j]; j++; } ii=0; IE = 0; U0IER = 1; } } }