Pravin Gosavi
Member
Hello. I'm sending data using UART from one end to recieve at the other end, process it and display on GLCD. I'm recieving the data right. But I'm confused how to display it on GLCD. I'm using MicroC for PIC compiler. Using its inbuilt libraries.
Setup: PIC16F877 ----> HC-12 -----> HC-12---> PIC16F877---> GLCD and some LEDs
Here are some snippets of the transmitter and reciever code.
Transmitter side:
Reciever side:
Displayed "]" represents "93" is recieved which is correct, but I want to print 93 not "]".
Recieved "txt" via UART is a string (I guess) still do I need to convert it to string or is there problem in method of printing the value. Bit slow understanding LCDs and strings and the libraries.
Setup: PIC16F877 ----> HC-12 -----> HC-12---> PIC16F877---> GLCD and some LEDs
Here are some snippets of the transmitter and reciever code.
Transmitter side:
Code:
if(display_time == 1)
{
UARt1_Write_Text(",");
if(Temp_flag == 0) UART1_Write('i');
else UART1_Write('m');
UART1_Write(TEMP_PERC); //Analogue value between 0-100
UART1_Write(')');
}
Reciever side:
Code:
char txt[16];
if (UART1_Data_Ready() == 1)
{
check1 = UART1_Read();
if(check1 == 'i')
{
RECEPT_LED = 1;
UART1_Read_Text(txt,")",1); // reads text until ')' is found
i_LED = 1;
m_LED = 0;
RECEPT_LED = 0;
}
.
.
if(m_LED == 1)
{
Glcd_Set_Font(Font_Glcd_Character8x7, 8, 7, 32);
Glcd_Write_text(Ltrim(txt), 45, 2, 1); // if I print "txt" a bracket is printed like this "]"
Glcd_Write_Text("%", 70, 2, 1);
}
Recieved "txt" via UART is a string (I guess) still do I need to convert it to string or is there problem in method of printing the value. Bit slow understanding LCDs and strings and the libraries.
Last edited by a moderator: