Arduino Function: RobotControl.text


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.


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


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.


#include <ArduinoRobot.h>

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

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

 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);

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

Based on the reference originally written by Arduino Community, and