I have multiple doubts, hopefully i can get clarified here
Code:
int16 datatotransmit[100];
int main()
{
while (index <= 90) /*transmitting 90 elements of datatotransmit array */
{
send(datatotransmit[index]);
index++;
}
}
void send(int16 data)
{
char buffer[10];
sprintf(buffer,"%d",data);
while(buffer[index] != 0)
{
UartSend((uint8)buffer[index]);
index++;
}
}
/*UartSend is the function generated by the library which accepts uint8*/
UartSend(uint8 data)
{
/*Function to send data over UART*/
}
datatotransmit is an array filled by other function, let us say it has filled with the below values
Code:
datatotransmit[0] = 123;
datatotransmit[1] = 512;
datatotransmit[2] = -400;
datatotransmit[3] = -512;
Q1. Is the send function correct?
Q2. For example if the datatotransmit[0] = 123;
then input to UartSend will be
Ascii value of '1', '2', '3' is it correct? and for negative values it will be for example -512
Ascii value of '-', '5','1','2' ? created by Send() function.
Please help.