RB-ARD-ROBOT-Func-text
text()
Description
Classe RobotControl, librairie d'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
#include <ArduinoRobot.h> void setup(){ Robot.begin(); Robot.beginTFT();//Initialise le module TFT } void loop(){ Robot.fill(255,255,255); Robot.text("Hello World",0,0); delay(2000); // Il est nécessaire d'effacer l'ancien texte avant d'écrire le nouveau Robot.fill(0,0,0); Robot.text("Bonjour le mode",0,0,false); Robot.fill(255,255,255); Robot.text("Je suis un robot",0,0); delay(3000); Robot.fill(0,0,0); Robot.text("Je suis un robot",0,0); }
Voir aussi
Source: Arduino Robot, getting started with the Arduino Robot, the Robot's library pages. Crédit: Arduino.cc, licence Creative Common Attribution ShareAlike.
Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : « Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.
L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.