Strange Character on LCD

Hello,

I just started using my LCD screen and started a few basic projects. The first was to define a string in the code and then write it on the LCD which worked well, however I'm now trying to read the serial port and write this to the screen. When I do this, I first realised I have to reset the cursor to the start of the line otherwise the text gets added to the end of the last text, but after every string it has a strange four line character on the screen.

If I type a string in the serial output and put four spaces, the character is shown after the spaces. I imagine this is some sort of strange ASCII character that is getting added on, any idea how I can stop it?

You are probably sending the New line or Carrage return characters - parse your output to remove them.

missdrew:
You are probably sending the New line or Carrage return characters - parse your output to remove them.

I think that may do it, but how do I parse it? What command do I use?
Separately I tried adding ' ' characters to the end of the string to make it 16 characters long, but for some strange reason that didnt work as it was adding the spaces to another line, as you say probably there is a carriage return in the way. What do I do to remove it?
Thanks

I see from other posts it may be better to use characters rather than a string but would be better to use string if possible

Read the character into a variable, check if the variable has the ASCII code for the New Line, or Carrage Return, if it does not, then print it to the LCD.

I've figured it out now, I can turn off new line ending in the serial monitor and it stops the character appearing

This topic was automatically closed after 70 days. New replies are no longer allowed.