Ligne 6 : |
Ligne 6 : |
| Classe [[Arduino Robot-Librairie#Classe_RobotControl|RobotControl]], librairie d'[[Arduino Robot-Librairie|Arduino Robot]]. | | Classe [[Arduino Robot-Librairie#Classe_RobotControl|RobotControl]], librairie d'[[Arduino Robot-Librairie|Arduino Robot]]. |
| | | |
− | Write some text to an attached TFT.
| + | Afficher/écrire du texte sur l'écran 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.
| + | Lors d'une mise à jour de l'écran, n'oubliez pas d'effacer le texte avant d'écrire un nouveau texte à la même place sinon, le nouveau et l'ancien text vont sur superposer. |
| | | |
− | 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.
| + | L'écran fait seulement 128 pixels de haut et 160 pixels de large. Il est recommander d'utiliser de petites valeurs pour x et y sinon le texte risque d'être coupé ou invisible. |
| | | |
| == Syntaxe == | | == Syntaxe == |
Ligne 18 : |
Ligne 18 : |
| == Paramètres == | | == Paramètres == |
| | | |
− | * '''toWrite''': text/value to be written on the LCD. Can be a string, an int or a long. | + | * '''toWrite''': texte/valeur a écrire (afficher) sur l'écran LCD. Peut être une ''string'', un ''int'' ou un ''long''. |
− | * '''x''': x axis of starting position on the screen. | + | * '''x''': position sur l'axe x de l'écran (où afficher le texte). |
− | * '''y''': y axis of starting position on the screen. | + | * '''y''': position sur l'axe y de l'écran (où afficher le texte). |
− | * '''writeOrErase''': specify whether to write the text or erase the text. Use true to write and false to erase. | + | * '''writeOrErase''': permet d'indiquer si l'on veut écrire ou effacer le texte. utiliser ''true'' (vrai) pour écrire et ''false'' (faux) pour effacer. |
| | | |
| == Résultat == | | == Résultat == |
Ligne 38 : |
Ligne 38 : |
| void loop(){ | | void loop(){ |
| Robot.fill(255,255,255); | | Robot.fill(255,255,255); |
− | Robot.text("Hello World",0,0); | + | Robot.text("Bonjour à tous",0,0); |
| delay(2000); | | delay(2000); |
| | | |
| // Il est nécessaire d'effacer l'ancien texte avant d'écrire le nouveau | | // Il est nécessaire d'effacer l'ancien texte avant d'écrire le nouveau |
| Robot.fill(0,0,0); | | Robot.fill(0,0,0); |
− | Robot.text("Bonjour le mode",0,0,false); | + | Robot.text("Bonjour à tous",0,0,false); |
| | | |
| Robot.fill(255,255,255); | | Robot.fill(255,255,255); |