TFT.TFT()

名称

TFT.TFT()

説明

TFTスクリーンに描画するための基底クラス。スケッチで、TFTクラスのインスタンスを作成するために使用する。

Arduino Esploraを使うときは、これを呼び出す必要はない。スクリーンに対する全ての参照は、EsploraTFTによって行われる。

書式

TFT::TFT(uint8_t CS, uint8_t RS, uint8_t RST);

Adafruit_ST7735::Adafruit_ST7735(uint8_t cs, uint8_t rs, uint8_t sid, uint8_t sclk, uint8_t rst);

引数

CS/csチップセレクト用のピン番号。
RS/rs使用するピン番号。
RST/rstリセット用のピン番号。
sidハードウェアSPIを利用しないときの、MOSI用ピン。
sclkハードウェアSPIを利用しないときの、クロック用ピン。

戻り値

なし。

使用例

 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
27
28
29
#include <SPI.h>
#include <TFT.h>            // Arduino LCD 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 stroke color to white
  screen.stroke(255,255,255);

  // turn off fill coloring
  screen.noFill();

  // draw a rectangle in the center of screen
  screen.line(screen.width()/2-5, screen.height()/2-5, 10, 10);
}

void loop() {

}

オリジナルのページ

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

最終更新日

January 8, 2024

inserted by FC2 system