Go Down

Topic: LiquidCrystal print() reference page doesn't show print(float) (Read 527 times) previous topic - next topic

caseyfw

I realise the print() used by the LiquidCrystal library is the same one used by Serial, and that the Serial spec shows the functionality for print() when passed a float type, but it seems odd to omit it from the LiquidCrystal page. The way it's written, it almost reads like lcd.print() cannot handle float types:

Quote
data: the data to print (char, byte, int, long, or string)


Sorry, I'm new here. How are the arduino.cc reference pages maintained? Are they in a git repository somewhere that I can patch?

Cheers,
Casey

robtillaart

it should be able to print floats as lcd.print is derived from the Print class (at least since version ...?)

Which IDE version are you using?
Which lcd library?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

pYro_65

Yes robtillaart is correct, it inherits the print library, so it has the same capabilities as the Serial library.

Incase you didn't know, the print and println overloads for float accept a precision parameter.

Serial.print( 123.4567f );      <-- This will print "123.46"

Serial.print( 123.4567f, 4 );  <-- This will print "123.4567"

Go Up