From 1c79b34b12a77f4e6c6f1bc167dbccc3f019b435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A1=A9=E5=85=A5=E5=AD=94=E7=AB=A0?= Date: Tue, 18 Dec 2018 18:12:51 +0800 Subject: [PATCH] add api ref lcd-arduino-ja --- docs/ja/api_reference/arduino/api_lcd.md | 144 ++++++++++++++++++++ docs/zh_CN/api_reference/arduino/api_lcd.md | 2 +- 2 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 docs/ja/api_reference/arduino/api_lcd.md diff --git a/docs/ja/api_reference/arduino/api_lcd.md b/docs/ja/api_reference/arduino/api_lcd.md new file mode 100644 index 00000000..f76ba1a3 --- /dev/null +++ b/docs/ja/api_reference/arduino/api_lcd.md @@ -0,0 +1,144 @@ +# LCD + + + +*画面の解像度は横320x縦240で左上を(0,0)とします。* + +### M5.lcd.setBrightness(uint8_t brightness); + +**画面全体の明るさを設定します。** + +| 引数 | 説明 | +|:---|:---| +| brightness | 画面の明るさ(0-254) | + +**使用例** + +```c++ +M5.lcd.setBrightness(200); +``` + +--- + +### M5.Lcd.setCursor(uint16_t x0, uint16_t y0); + +**表示開始位置を設定します。(x0, y0)** + +| パラメータ | 説明 | +|:---|:---| +| x0 | カーソルのx座標 | +| y0 | カーソルのy座標 | + +**使用例** + +```c++ +M5.lcd.setCursor(20, 40); +``` + +--- + +### M5.Lcd.fillScreen(uint16_t color); + +**画面全体を指定された色で塗りつぶします。** + +| パラメータ | 説明 | +|:---|:---| +| color | 塗りつぶしの色 | + +**使用例** + +```c++ +M5.Lcd.fillScreen(BLUE); +``` + +--- + +### M5.Lcd.drawPixel(int16_t x, int16_t y, [uint16_t color]); + +**位置(x, y)にcolorで指定した色の点を描画します。** + +*もしcolorを指定しない場合は、現在の背景色が使用されます。* + +| パラメータ | 説明 | +|:---|:---| +| x | 点のx座標 | +| y | 点のy座標 | +| color | 点の色 | + +**使用例** + +```c++ +M5.Lcd.drawPixel(20, 40, BLUE); +``` + +--- + +### M5.Lcd.drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color); + +**始点(x0, y0)から終点(x1, y1)にcolorで指定した色の直線を描画します。** + +*もしcolorを指定しない場合は、現在の背景色が使用されます。* + +| パラメータ | 説明 | +|:---|:---| +| x0 | 線の始点のx座標 | +| y0 | 線の始点のy座標 | +| x1 | 線の終点のx座標 | +| y1 | 線の終点のy座標 | +| color | 線の色 | + +**使用例** + +```c++ +M5.Lcd.drawLine(0, 0, 12, 12, BLUE); +``` + +--- + +### M5.Lcd.drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); + +**colorで指定した色の線で3つの頂点(x0, y0)、(x1, y1)、(x2, y2)を持つ三角形を描画します。** + +*もしcolorを指定しない場合は、現在の背景色が使用されます。* + +| パラメータ | 説明 | +|:---|:---| +| x0 | 三角形の頂点Aのx座標 | +| y0 | 三角形の頂点Aのy座標 | +| x1 | 三角形の頂点Bのx座標 | +| y1 | 三角形の頂点Bのy座標 | +| x2 | 三角形の頂点Cのx座標 | +| y2 | 三角形の頂点Cのy座標 | +| color | 線の色 | + +**使用例** + +```c++ +M5.Lcd.drawTriangle(22, 22, 69, 98, 51, 22, BLUE); +``` + +--- + +### M5.Lcd.fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); + +**colorで指定した色に塗りつぶされた頂点(x0, y0)、(x1, y1)、(x2, y2)を持つ三角形を描画します。** + +*もしcolorを指定しない場合は、現在の背景色が使用されます。* + +| パラメータ | 説明 | +|:---|:---| +| x0 | 三角形の頂点Aのx座標 | +| y0 | 三角形の頂点Aのy座標 | +| x1 | 三角形の頂点Bのx座標 | +| y1 | 三角形の頂点Bのy座標 | +| x2 | 三角形の頂点Cのx座標 | +| y2 | 三角形の頂点Cのy座標 | +| color | 線の色 | + +**使用例** + +```c++ +M5.Lcd.fillTriangle(122, 122, 169, 198, 151, 182, BLUE); +``` + +--- diff --git a/docs/zh_CN/api_reference/arduino/api_lcd.md b/docs/zh_CN/api_reference/arduino/api_lcd.md index b0e67bb1..a82da5c9 100644 --- a/docs/zh_CN/api_reference/arduino/api_lcd.md +++ b/docs/zh_CN/api_reference/arduino/api_lcd.md @@ -33,7 +33,7 @@ M5.lcd.setCursor(20, 40); ### M5.Lcd.fillScreen(uint16_t color); **例程** ```c++ -M5.Lcd.fillScreen(BLUE) +M5.Lcd.fillScreen(BLUE); ``` **以指定的颜色填充整个屏幕。**