TFT.text()

名称

TFT.text()

説明

スクリーン上の、指定した座標に文字列を書く。

書式

void Adafruit_GFX::text(const char * text, int16_t x, int16_t y);

引数

textスクリーン上に書きたい文字列。
xスクリーン上に文字列を書き出す開始位置のX座標。
yスクリーン上に文字列を書き出す開始位置のY座標。

戻り値

なし。

使用例

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <SPI.h>
#include <TFT.h>            // Arduino TFT library

#define cs   10
#define dc   9
#define rst  8

TFT screen = TFT(cs, dc, rst);

void setup() {
  // initialize the screen
  screen.begin();

  // make the background black
  screen.background(0,0,0);

  // set the text color to white
  screen.stroke(255,255,255);

  // write text to the screen in the top left corner
  screen.text("Testing!", 0, 0);
}

void loop() {

}

オリジナルのページ

https://www.arduino.cc/reference/en/libraries/tft/text/

最終更新日

January 8, 2024

inserted by FC2 system