Modifications

Sauter à la navigation Sauter à la recherche
1 527 octets ajoutés ,  17 septembre 2013 à 10:33
Page créée avec « {{Arduino-Robot-NAV}} <h4>text()</h4> == Description == Classe RobotControl, librairie d'[[Arduino Robot-Librairie|Arduino R... »
{{Arduino-Robot-NAV}}

<h4>text()</h4>

== Description ==
Classe [[Arduino Robot-Librairie#Classe_RobotControl|RobotControl]], librairie d'[[Arduino Robot-Librairie|Arduino Robot]].

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.

== Syntaxe ==

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

== Paramètres ==

* '''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.

== Résultat ==

aucun

== Exemple ==

<nowiki>#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);
}</nowiki>

== Voir aussi ==
* [[RB-ARD-ROBOT-Func-beginTFT|beginTFT()]]
* [[RB-ARD-ROBOT-Func-drawBMP|drawBMP()]]
* [[RB-ARD-ROBOT-Func-debugPrint|debugPrint()]]

{{Arduino-Robot-TRAILER}}
29 917

modifications

Menu de navigation