Pages: [1]   Go Down
Author Topic: LiquidCrystal print() reference page doesn't show print(float)  (Read 488 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

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

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


Global Moderator
Offline Offline
Shannon Member
Karma: 224
Posts: 13917
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 -,77.0.html -
(Please do not PM for private consultancy)

North Queensland, Australia
Offline Offline
Edison Member
Karma: 74
Posts: 2225
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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"

Pages: [1]   Go Up
Jump to: