drawText()

[Graphics]
void drawText (int x, int y, const char* text);

Description

Draws text on the chip.

Parameters

x: the x-coordinate where the text will begin.

y: the y-coordinate where the text will begin.

text: the text to be drawn.

Returns

Nothing.

Example Code

The code draws the string “Hello” in the center of the chip.

void setup() {
    int width = chipWidth();   // gets the width of the chip
    int height = chipHeight(); // gets the height of the chip
    
    // draws the string "Hello" in the center of the chip
    drawText(width / 2, height / 2, "Hello");
}

void loop() {
}

Notes and Warnings

All coordinates must be inside the chip boundaries, use the functions chipWidth() and chipHeight() to get the chip dimensions.