Yes, end of line character processing is an issue when using nearly all the Arduino LCD libraries.
(I have seen newline character processing implemented in 1 LCD library)
But in general there is no single correct answer as to how to handle new line processing
as sometimes you want new line processing and some times you don’t.
That is why most real systems have tty disciplines that can be set by the
application so it can control whether or not new line processing is wanted.
I think I was a bit unclear by what watertrade meant by
I can’t get the temperatures to display on the LCD
I assumed he meant exactly what he said: He didn’t see any of the temperature digits.
With the small example provided, I would have thought that the temperature should have printed but then be followed by two
unpredictable characters after the final digit of the temperature because of using println() vs print().
Not seeing any of the the temperature digits
is a different problem than getting extra garbage characters on the end of the temperature.
But then many things about the issue are still unclear including which library is being used.
Maybe one of the LCD3wire libraries referenced here: http://www.arduino.cc/playground/Code/LCD3wires ???
The compiler doesn’t play a role in this. It is all up to the libraries and/or the device receiving the character data.
The Print class sends and characters to the underlying library whenever println() is called.
is implemented as:
In the case of the serial port, if your terminal monitoring “device” processes end of line characters
(which the Arduino serial monitor does), the and characters are interpreted by the terminal
monitor and do what is expected (wrap, and drop the next line or scroll when necessary).
In the case of an LCD, like you said, the LCD does not interpret and as end of line characters
but rather as printable characters that map into the custom characters.
While it it possible to implement end of line processing for and characters in the LCD library,
out of more than a dozen Arduino LCD libraries I’ve seen, only one has implemented newline processing
to provide wrapping (but no scrolling) capability.
So yes, I do agree that println() shouldn’t really be used when using a LCD as it won’t do what is expected since
neither the LCD or the LCD library are processing the end of line characters.
what is needed to really comment on how to resolve your issue is all the information needed to replicate the issue.
- a full description of what you are seeing vs what you expected to see
- a pointer to the exact library you are using
(This is very important as there are many SR libraries out there that have issues)
- example sketch that demonstrates the issue
Anything less, and we are all guessing about what is happening and how to solve it.
Taking another guess, from looking at 2 different versions of LCD3wire on the link referenced above, both have issues.
The early one doesn’t support the Print class so print() won’t work as expected.
Both the early one and the more recent one will have issues with cursor positioning on certain
And neither will work with Arduino 1.x
I’d recommend switching to fm’s library as it doesn’t have these issues
and works with pre or post 1.x Arduino.