Arduboy2 Library  6.0.0
Print Class Reference

The Arduino Print class is available for writing text to the screen buffer. More...

#include <Arduboy2.h>

+ Inheritance diagram for Print:

Detailed Description

The Arduino Print class is available for writing text to the screen buffer.

For an Arduboy2 class object, functions provided by the Arduino Print class can be used to write text to the screen buffer, in the same manner as the Arduino Serial.print(), etc., functions.

Print will use the write() function to actually draw each character in the screen buffer, using the library's font5x7 font. Two character values are handled specially:

  • ASCII newline/line feed (\n, 0x0A, inverse white circle). This will move the text cursor position to the start of the next line, based on the current text size.
  • ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored.

To override the special handling of the above values, to allow the characters they represent to be printed, text raw mode can be selected using the setTextRawMode() function.

See: https://www.arduino.cc/reference/en/language/functions/communication/serial/print/

Example:

int value = 42;
arduboy.println("Hello World"); // Prints "Hello World" and then sets the
// text cursor to the start of the next line
arduboy.print(value); // Prints "42"
arduboy.print('\n'); // Sets the text cursor to the start of the next line
arduboy.print(78, HEX); // Prints "4E" (78 in hexadecimal)
arduboy.print("\x03\xEA"); // Prints a heart symbol and a Greek uppercase omega
arduboy.setTextRawMode(true); // Set text "raw" mode
arduboy.print("\r\n") // Prints a "musical eighth note"
// followed by an "inverse white circle"
// because we're in "raw" mode
arduboy.setTextRawMode(false); // Exit text "raw" mode
See also
Arduboy2::setTextSize() Arduboy2::setTextColor() Arduboy2::setTextBackground() Arduboy2::setTextWrap() Arduboy2::setTextRawMode() Arduboy2::write() Arduboy2::font5x7

The documentation for this class was generated from the following file:
Arduboy2::setTextRawMode
static void setTextRawMode(bool raw)
Set or disable text raw mode, allowing special characters to be displayed.
Definition: Arduboy2.cpp:1484