propeller c
pilot0315
Posts: 952
I am parsing a gps. When the clock hits 59 my screen jumps and sends a line of data below. Any ideas?? Thanks
// print("rmc magvar %s\n\n", _rmcmagvar);
print("day %d month %d year %d\n",day,month,year);
print("JD_adder %d\n\n",JD_adder);
print("A %d\n\n",A);
print("B %d\n\n",B);
// print("_gmathrs %d\n\n", _gmathrs);
// print("decimal_day %f\n\n", decimal_day);
// print("%c",NL);
print("%c",HOME);
pause(499);
// print("rmc magvar %s\n\n", _rmcmagvar);
print("day %d month %d year %d\n",day,month,year);
print("JD_adder %d\n\n",JD_adder);
print("A %d\n\n",A);
print("B %d\n\n",B);
// print("_gmathrs %d\n\n", _gmathrs);
// print("decimal_day %f\n\n", decimal_day);
// print("%c",NL);
print("%c",HOME);
pause(499);

Comments
How did you declared the variables "NL" and "HOME"? Displaying chars may be tricky. Anyway, there is a chance you may be printing a control character (like a TAB or a newline).
Kind regards, Samuel Lourenço
Thanks
print("%c",CLREOL);
print("%c",HOME);
I set the timing to 1/2 sec as the gps feed is the same and I get a couple of characters that griefly show up and dissappear
but I think they sould not show up at all.
If you have a suggestion let me know.
Thanks
// print("%d",BKSP); // print("%d",CLREOL);As long as these are commented out there shouldn't be a problem. However, if you comment them out the control characters BKSP and CLREOL will be converted to an ACSII string representing the decimal values of BKSP and CLREOL. This are defined in simpletools.h as 9 and 11, so with those two lines uncommented you would have seen "911" on the screen. Your original example showed "1313", which could have been caused by having two print("%d",CR) statements. As you determined through experimentation, the "%c" format should be used to send control characters to the screen. Alternatively, you can just used putchar() to send out a single character, such as putchar(CLREOL).One comment about sending the newline character, NL. The standard IO routines will actually send both NL and CR characters when attempting to send the NL character. You have to put standard out into an uncooked mode to send out the NL character only. Using the uncooked mode is important when using the CRSRX, CRSRY or CRSRXY control characters followed by a value of 10.
Kind regards, Samuel Lourenço
-Mike