Arduino - RobotText

Arduino

Reference Language | Libraries | Comparison | Changes

Robot

## text()

#### Description

Write some text to an attached TFT.

When updating the screen, remember to erase the text before writing new text on the same place, or the new/old text will be overlapping each other.

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.

#### Returns

none

#### Examples

#include <ArduinoRobot.h>
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);
}
[Get Code]

#### See also

- beginTFT()
- drawBMP()
- debugPrint()

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.

### Share

### This link has expired.
Please re-subscribe to our Newsletters.

### Subscribe to our Newsletters

Email

Please enter a valid email to subscribe

Arduino Newsletter
Arduino Store Newsletter

### Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy

###### Newsletter

- ©2015 Arduino
- Copyright Notice
- Contact us
- About us
- Careers