Go Down

Topic: extra chars displayed at end (Read 541 times) previous topic - next topic

mstadtler

Code: [Select]
I am using an analog value to index through and array and display messages
on the sparkfun serial LCD

Everything works except I get extra || ||| every time

Got any ideas?


I attached some of the code, it's big.

[ftp]http://s847.photobucket.com/albums/ab37/mstadtler/
[/ftp]

/code]
prog_char string_16[] PROGMEM = "16 Dulcimer";

PROGMEM const char *string_table[] =    // change "string_table" name to suit
{
string_0,string_1,string_2,string_3,string_4,string_5,string_6,string_7,string_8,string_9,
string_10,string_11,string_12,string_13,string_14,string_15,string_16,string_17,

strcpy_P(buffer, (char*)pgm_read_word(&(string_table[instrument]))); // Necessary casts and dereferencing, just copy.
   Serial.println( buffer );
    delay( 500 );



extent

that's probably the newline character at the end of the string.  Strip off the "\n" at the end and the |||s will go away.

floresta

Quote
Strip off the "\n" at the end and the |||s will go away.

You do this by using Serial.print() instead of Serial.println().  You will have to reposition the cursor to advance to the next line unless your particular serial device uses some other technique.

Please use the code button only for the code portions of your post.  You have used it for your entire post.


Don

liudr

I guess they are end of line character as well. Splarfun Serial LCD doesn't know how to handle it. You have to handle it yourself or maybe should have bought my version of serial LCD that does handle everything ;)

mstadtler

Thanks for the help, Serial.print worked. I will work on my posting skills for next time.

Go Up