Arduino openGLCD Library Version v1.0rc2 |

All Classes Functions Variables Enumerations Enumerator Groups Pages
Arduino print Functions

All of the Arduino print functions can be used in this library, see: Serial Print Functions

The functions work with any selected font. All of these functions print from the current cursor position

See also
  Printf()
  Puts()
  CursorTo(), CursorToXY()

GLCD.print(character); // print the character at the current cursor position
GLCD.print(integer); // print the decimal value of the integer
GLCD.print(integer,DEC); // as above
GLCD.print(integer, HEX); // print the hexadecimal value of the integer
GLCD.print(integer, OCT) ; // print the octal value of the integer
GLCD.print(integer, BIN) ; // print the binary value of the integer
GLCD.print(integer, BYTE); // print the ASCII character represented by the integer
GLCD.print(float); // print a floating point number using two decimal places
GLCD.print(float, digits); // print a floating point number using the given number of digits after the decimal point
GLCD.print(string); // print the string
GLCD.print("string"); // print the literal string

The println variants of these functions are also supported:

GLCD.println(variable); // will wrap to the next line at the end of the print.

Because of the AVR processor architecture, character strings consume RAM. This is not the case for other processors like ARM or PIC32. The Arduino sytem includes a F() macro to help work around this AVR issue. Printing strings using the F() macro results in the compiler not using RAM on AVR based systems to store the string. The F() macro can also be used on non AVR based systems.

GLCD.print("string"); // on AVR the compiler reserves 7 bytes of RAM (characters + 1) to store the string
GLCD.print(F("string") ); // no RAM is used to store the string, regardless of the processor