Arduino Function: RobotControl.text

Description

This funcion is used to write a text to an attached TFT. When updating the screen, you need to clear the screen before writing a new one to avoid overlaps. The screen is only 128 pixels tall and 160 pixels wide. It's recommended to use small values for x and y, or text may be cropped/invisible in unpredictable ways.

Syntax

Robot.text(toWrite, x, y, writeOrErase)

Parameters

toWrite: text/value to be written on the LCD. Can be a string, an int or a long. *x: x axis of starting position on the screen. *y: y axis of starting position on the screen. *writeOrErase: specify whether to write the text or erase the text. Use true to write and false to erase.

Examples

#include 

void setup(){
 Robot.begin();
 Robot.beginTFT();//Initialize the TFT module
}

void loop(){
 Robot.text("Hello World",0,0,true);
 delay(2000);

 Robot.text("Hello World",0,0,false);//It's necessary to erase the old text, for showing new text
 Robot.text("I am a robot",0,0,true);
 delay(3000);

 Robot.text("I am a robot",0,0,false);
}


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc