Pages: [1]   Go Down
Author Topic: LiquidCrystal print() reference page doesn't show print(float)  (Read 448 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
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:

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
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
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?
Logged

Rob Tillaart

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

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 66
Posts: 2116
View Profile
WWW
 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"
Logged


Pages: [1]   Go Up
Jump to: