TFT.background()

名称

TFT.background()

説明

LCDに表示されているすべてのものを、指定した色で塗りつぶす。loop()の中で使って、スクリーンをクリアするのに使うことができる。

background()は、赤と緑、青のそれぞれを8ビットの値で指定できるが、指定した色を忠実に再現できるわけではない。赤と青は5ビット(32段階)に、緑は6ビット(64段階)に変換される。

書式

void Adafruit_GFX::background(uint8_t red, uint8_t green, uint8_t blue);

引数

red 0-255。
green0-255。
blue0-255。

戻り値

なし。

使用例

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#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 white
  screen.background(255,255,255);
}

void loop() {

}

オリジナルのページ

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

最終更新日

January 8, 2024

inserted by FC2 system