arduino-libraries / LiquidCrystal

Liquid Crystal Library for Arduino
http://arduino.cc/
253 stars 170 forks source link

LCD println does not go to a new line #45

Open per1234 opened 3 years ago

per1234 commented 3 years ago

Moved from https://github.com/arduino/Arduino/issues/2191 by @anthony-ngu

The LiquidCrystal Library should handle '\r' and '\n' characters properly.

When a println is used, it sends both the \r and \n characters and the LiquidCrystal library prints those characters out. Instead it should set the cursor to a row below.

per1234 commented 3 years ago

From agdl on 2015-01-12:

@anthony-ngu The LCD controller prints on the LCD everything you do to it so it is normal that you get those characters. In order to change line you have to set the cursor to the new line using setCursor()

per1234 commented 3 years ago

From JulyJim on 2015-01-12:

agdl Your "answer" is correct, but closing the issue is questionable. Most "Arduino libraries" are build as simple stand alone code thus their integration into projects needs some work. Nothing wrong with that. However, C++ has a feature called "inheritance" which is seldom implemented in these add-on libraries. I realize using inheritance from Print class would made for additional work for the author of LiquidCrystal but would "upgrade" Arduino from "blink without delay" toy to powerful processor.

per1234 commented 3 years ago

From agdl on 2015-01-12:

@VaclavSal I reopen it, but i think that since this issue is here from 18th of july and nobody worked on it since you can simply place a setCursor, it will stay here for good..

per1234 commented 3 years ago

From benjaminmordaunt on 2021-03-24

I realize using inheritance from Print class would made for additional work for the author of LiquidCrystal but would "upgrade" Arduino from "blink without delay" toy to powerful processor.

JulyJim cmaglie

There's an awful lot more work needed in both Arduino standard library code quality and documentation before that jump will happen. Also, inheritance from any standard printing class in Arduino core wouldn't make sense.

The buffering techniques used here mean text is handed line-by-line, with buffers having no knowledge of the line beneath/above them. Changing this has major implications in features such as text scrolling, too. This should be closed.