Hello everybody.
I'm trying to build a gps monitoring system.
My problem is that I can't store continuously varying characters within an array.
The array must contain the set of characters that will subsequently be printed on an LCD screen.
the code excerpt is this:
while (! UART1_Data_Ready ());
Temp = UART1_Read (); // skip the first comma
Lcd_Cmd (_LCD_FIRST_ROW);
Lcd_Out_Cp ("UTC:"); // displaying UTC on LCD
while (Temp! = ',')
{
Lcd_Chr_Cp (Temp); // Displaying Time on LCD
while (! UART1_Data_Ready ());
Temp = UART1_Read ();
Index ++;
if (Index == 2 || Index == 4)
Lcd_Chr_Cp (':');
}
lcd_cmd (_lcd_clear);
Index = 0;
what I would like to do is something like this:
while (! UART1_Data_Ready ());
Temp = UART1_Read (); // skip the first comma
Lcd_Cmd (_LCD_FIRST_ROW);
Lcd_Out_Cp ("UTC:"); // displaying UTC on LCD
while (Temp! = ',')
{
array [] = Temp;
while (! UART1_Data_Ready ());
Temp = UART1_Read ();
Index ++;
if (Index == 2 || Index == 4)
Lcd_Chr_Cp (':');
}
lcd_out (1,1, array []);
lcd_cmd (_lcd_clear);
Index = 0;
Only doing it this way doesn't work at all
and I can't figure out how to do it.
i made this code in Mikroc with pic 16f877a.
I have also attached all the original code and the proteus program.
A sincere thanks to all those who will try to give me a hand.
Sorry for the poor English.
Thank you all.
Long live electronics
Thanks again.
I'm trying to build a gps monitoring system.
My problem is that I can't store continuously varying characters within an array.
The array must contain the set of characters that will subsequently be printed on an LCD screen.
the code excerpt is this:
while (! UART1_Data_Ready ());
Temp = UART1_Read (); // skip the first comma
Lcd_Cmd (_LCD_FIRST_ROW);
Lcd_Out_Cp ("UTC:"); // displaying UTC on LCD
while (Temp! = ',')
{
Lcd_Chr_Cp (Temp); // Displaying Time on LCD
while (! UART1_Data_Ready ());
Temp = UART1_Read ();
Index ++;
if (Index == 2 || Index == 4)
Lcd_Chr_Cp (':');
}
lcd_cmd (_lcd_clear);
Index = 0;
what I would like to do is something like this:
while (! UART1_Data_Ready ());
Temp = UART1_Read (); // skip the first comma
Lcd_Cmd (_LCD_FIRST_ROW);
Lcd_Out_Cp ("UTC:"); // displaying UTC on LCD
while (Temp! = ',')
{
array [] = Temp;
while (! UART1_Data_Ready ());
Temp = UART1_Read ();
Index ++;
if (Index == 2 || Index == 4)
Lcd_Chr_Cp (':');
}
lcd_out (1,1, array []);
lcd_cmd (_lcd_clear);
Index = 0;
Only doing it this way doesn't work at all
and I can't figure out how to do it.
i made this code in Mikroc with pic 16f877a.
I have also attached all the original code and the proteus program.
A sincere thanks to all those who will try to give me a hand.
Sorry for the poor English.
Thank you all.
Long live electronics
Thanks again.
Attachments
-
5.2 KB Views: 3
-
485.3 KB Views: 5