From fb7b079a7971e70180838fe2693e940a1ad725ab 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, 4 Dec 2018 15:00:14 +0800 Subject: [PATCH] add ja lcd api reference --- docs/en/api_reference.md | 2 +- .../{ => micropython}/api_lcd.md | 4 +- .../api_reference/micropython}/api_speaker.md | 2 + .../micropython}/peripherals/api_gpio.md | 2 + docs/ja/api_reference.md | 7 +- docs/ja/api_reference/api_lcd.md | 73 ------ docs/ja/api_reference/micropython/api_lcd.md | 245 ++++++++++++++++++ .../api_reference/micropython}/api_speaker.md | 2 + .../micropython}/peripherals/api_gpio.md | 2 + docs/ja/faq.md | 4 +- docs/zh_CN/api_reference.md | 2 +- .../{ => micropython}/api_lcd.md | 4 +- .../{ => micropython}/api_speaker.md | 2 + .../{ => micropython}/peripherals/api_gpio.md | 2 + 14 files changed, 268 insertions(+), 85 deletions(-) rename docs/en/api_reference/{ => micropython}/api_lcd.md (96%) rename docs/{ja/api_reference => en/api_reference/micropython}/api_speaker.md (65%) rename docs/{ja/api_reference => en/api_reference/micropython}/peripherals/api_gpio.md (71%) delete mode 100644 docs/ja/api_reference/api_lcd.md create mode 100644 docs/ja/api_reference/micropython/api_lcd.md rename docs/{en/api_reference => ja/api_reference/micropython}/api_speaker.md (65%) rename docs/{en/api_reference => ja/api_reference/micropython}/peripherals/api_gpio.md (71%) rename docs/zh_CN/api_reference/{ => micropython}/api_lcd.md (96%) rename docs/zh_CN/api_reference/{ => micropython}/api_speaker.md (65%) rename docs/zh_CN/api_reference/{ => micropython}/peripherals/api_gpio.md (70%) diff --git a/docs/en/api_reference.md b/docs/en/api_reference.md index 42ae2f42..c9c26f51 100644 --- a/docs/en/api_reference.md +++ b/docs/en/api_reference.md @@ -2,7 +2,7 @@ [中文](/zh_CN/api_reference) | English | [日本語](/ja/api_reference) -## [LCD](en/api_reference/api_lcd) +## [LCD](en/api_reference/micropython/api_lcd) diff --git a/docs/en/api_reference/api_lcd.md b/docs/en/api_reference/micropython/api_lcd.md similarity index 96% rename from docs/en/api_reference/api_lcd.md rename to docs/en/api_reference/micropython/api_lcd.md index 0ad4325b..2a15870f 100644 --- a/docs/en/api_reference/api_lcd.md +++ b/docs/en/api_reference/micropython/api_lcd.md @@ -1,6 +1,6 @@ # LCD -[中文](https://m5stack.github.io/m5-docs/#/zh_CN/api_reference/api_lcd) | English +[中文](/zh_CN/api_reference/micropython/api_lcd) | English | [日本語](/ja/api_reference/micropython/api_lcd) ### lcd.setRotation(degree) @@ -24,7 +24,7 @@ lcd.setRotation(90) **Example** ```python lcd.setColor(lcd.RED) -lcd.setColor(lcd.ORANGE, LCD.DARKCYAN) +lcd.setColor(lcd.ORANGE, lcd.DARKCYAN) ``` **Set the default foreground/background color of text.** diff --git a/docs/ja/api_reference/api_speaker.md b/docs/en/api_reference/micropython/api_speaker.md similarity index 65% rename from docs/ja/api_reference/api_speaker.md rename to docs/en/api_reference/micropython/api_speaker.md index 8936220a..9cbd5a38 100644 --- a/docs/ja/api_reference/api_speaker.md +++ b/docs/en/api_reference/micropython/api_speaker.md @@ -1,5 +1,7 @@ # Speaker +[中文](/zh_CN/api_reference/micropython/api_speaker) | English | [日本語](/ja/api_reference/micropython/api_speaker) + ### tone > M5.Speaker.tone(uint32_t freq); diff --git a/docs/ja/api_reference/peripherals/api_gpio.md b/docs/en/api_reference/micropython/peripherals/api_gpio.md similarity index 71% rename from docs/ja/api_reference/peripherals/api_gpio.md rename to docs/en/api_reference/micropython/peripherals/api_gpio.md index 76abbad3..33abe530 100644 --- a/docs/ja/api_reference/peripherals/api_gpio.md +++ b/docs/en/api_reference/micropython/peripherals/api_gpio.md @@ -1,5 +1,7 @@ # GPIO +[中文](/zh_CN/api_reference/micropython/peripherals/api_gpio) | English | [日本語](/ja/api_reference/micropython/peripherals/api_gpio) + *Refer to GPIO API of [Arduino](http://www.arduino.cc)* ### digitalRead diff --git a/docs/ja/api_reference.md b/docs/ja/api_reference.md index b816d576..eba1782f 100644 --- a/docs/ja/api_reference.md +++ b/docs/ja/api_reference.md @@ -2,7 +2,6 @@ [中文](/zh_CN/api_reference) | [English](/en/api_reference) | 日本語 - \ No newline at end of file +| MicroPython | Arduino | +|:------------|:--------| +|[LCD](ja/api_reference/micropython/api_lcd) | / | \ No newline at end of file diff --git a/docs/ja/api_reference/api_lcd.md b/docs/ja/api_reference/api_lcd.md deleted file mode 100644 index dd9f15c7..00000000 --- a/docs/ja/api_reference/api_lcd.md +++ /dev/null @@ -1,73 +0,0 @@ -# LCD - -### setbrightness -> M5.Lcd.setbrightness(uint8_t brightness); - -Set the brightness of LCD. - -| Param | Type | Description | -| --- | --- | --- | -| brightness | uint8_t | brightness(0-254) | - -**Example** -```c++ -M5.Lcd.setbrightness(100); -``` - -* * * - -### fillScreen -> M5.Lcd.fillScreen(uint16_t color); - -Set the color to display of the whole LCD. - -| Param | Type | Description | -| --- | --- | --- | -| color | uint16_t | color value | - -**Example** -```c++ -M5.Lcd.fillScreen(RED); -delay(500); -M5.Lcd.fillScreen(WHITE); -delay(500); -``` - -* * * - -### fillRect -> M5.Lcd.fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); - -Draw a filled rectangle. - -| Param | Type | Description | -| --- | --- | --- | -| x, y | int16_t | offset of x, y direction | -| w, h | int16_t | width and height of graphics | -| color | uint16_t | color to fill | - -**Example** -```c++ -M5.Lcd.fillRect(50,50,60,150,WHITE); -``` - -* * * - -### fillRoundRect -> M5.Lcd.fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color); - -Draw a filled round rectangle. - -| Param | Type | Description | -| --- | --- | --- | -| x, y | int16_t | offset of x, y direction | -| w, h | int16_t | width and height of graphics | -| radius | int16_t | fillet radius | -| color | uint16_t | color to fill | - -**Example** -```c++ -M5.Lcd.fillRoundRect(50,50,60,150,4,WHITE); -``` - -* * * \ No newline at end of file diff --git a/docs/ja/api_reference/micropython/api_lcd.md b/docs/ja/api_reference/micropython/api_lcd.md new file mode 100644 index 00000000..ab64316a --- /dev/null +++ b/docs/ja/api_reference/micropython/api_lcd.md @@ -0,0 +1,245 @@ +# LCD + +[中文](/zh_CN/api_reference/micropython/api_lcd) | [English](/en/api_reference/micropython/api_lcd) | 日本語 + +### lcd.setRotation(degree) + +**画面全体の回転角度を設定します。** + +| パラメータ | 説明 | +|:---|:---| +| degree | 回転角度 | + +**使用例** + +```python +lcd.setRotation(90) +``` + +--- + +### lcd.setColor(color [, background_color]) + +**テキストの色と背景色を設定します。** + +| パラメータ | 説明 | +| :--- | :--- | +| color | テキストの色 | +| background_color| テキストの背景色 | + +**使用例** + +```python +lcd.setColor(lcd.RED) +lcd.setColor(lcd.ORANGE, lcd.DARKCYAN) +``` + +--- + +### lcd.fillScreen(color) + +**画面全体を指定した色で塗りつぶします。** + +| パラメータ | 説明 | +|:--- | :--- | +| color | 塗りつぶしの色 | + +**使用例** + +```python +lcd.fillScreen(lcd.RED) +``` + +--- + +### lcd.drawPixel(x, y [,color]) + +**(x,y)の位置に点(ピクセル)を描画します。** + +*色の指定がない場合は、現在設定されている前景色が使用されます。* + +| パラメータ | 説明 | +| :--- | :--- | +| x | 点のx座標 | +| y | 点のy座標 | +| color | 点の色 | + +**使用例** + +```python +lcd.drawPixel(22, 22, lcd.RED) +``` + +--- + +### lcd.drawLine(x, y, x1, y1 [,color]) + +**点(x,y) から 点(x1,y1) へ直線を描画します。** + +*色の指定がない場合は、現在設定されている前景色が使用されます。* + +| パラメータ | 説明 | +| :--- | :--- | +| x | 線の始点のx座標 | +| y | 線の始点のy座標 | +| x1 | 線の終点のx1座標 | +| y1 | 線の終点のy1座標 | +| color | 線の色 | + +**使用例** + +```python +lcd.drawLine(0, 0, 12, 12, lcd.WHITE) +``` + +--- + +### lcd.drawTriangle(x, y, x1, y1, x2, y2 [,color]) + +**3つの頂点 (x,y), (x1,y1), (x2,y2) を持つ三角形を描画します。** + +*色の指定がない場合は、現在設定されている前景色が使用されます。* + +| パラメータ | 説明 | +| :--- | :--- | +| x | 三角形の頂点0のx座標 | +| y | 三角形の頂点0のy座標 | +| x1 | 三角形の頂点1のx座標 | +| y1 | 三角形の頂点1のy座標 | +| x2 | 三角形の頂点2のx座標 | +| y2 | 三角形の頂点2のy座標 | +| color | 三角形の線の色 | + +**使用例** + +```python +lcd.drawTriangle(22, 22, 69, 98, 51, 22, lcd.RED) +``` + +--- + +### lcd.fillTriangle(x, y, x1, y1, x2, y2 [,color]) + +**3つの頂点 (x,y), (x1,y1), (x2,y2) を持つ三角形を塗りつぶします。** + +*色の指定がない場合は、現在設定されている前景色が使用されます。* + +| パラメータ | 説明 | +| :--- | :--- | +| x | 三角形の頂点0のx座標 | +| y | 三角形の頂点0のy座標 | +| x1 | 三角形の頂点1のx座標 | +| y1 | 三角形の頂点1のy座標 | +| x2 | 三角形の頂点2のx座標 | +| y2 | 三角形の頂点2のy座標 | +| color | 三角形の色 | + +**使用例** + +```python +lcd.fillTriangle(122, 122, 169, 198, 151, 182, lcd.RED) +``` + +--- + +### lcd.drawRect(x, y, w, h, [,color]) + +**左上の点(x,y)と幅と高さを指定して、四角形を描画します。** + +*色の指定がない場合は、現在設定されている前景色が使用されます。* + +| パラメータ | 説明 | +| :--- | :--- | +| x | 四角形の左上の頂点のx座標 | +| y | 四角形の左上の頂点のy座標 | +| w | 四角形の幅 | +| h | 四角形の高さ | +| color | 四角形の線の色 | + +**使用例** + +```python +lcd.drawRect(180, 12, 122, 10, lcd.BLUE) +``` + +--- + +### lcd.drawRoundRect(x, y, w, h, r [,color]) + +**左上の点(x,y)と幅と高さを指定して、かど丸の四角形を描画します。** + +*色の指定がない場合は、現在設定されている前景色が使用されます。* + +| パラメータ | 説明 | +| :--- | :--- | +| x | 四角形の左上の頂点のx座標 | +| y | 四角形の左上の頂点のy座標 | +| w | 四角形の幅 | +| h | 四角形の高さ | +| r | コーナー半径 | +| color | 四角形の線の色 | + +**使用例** + +```python +lcd.fillRoundRect(180, 70, 122, 10, 4, lcd.BLUE) +``` + +--- + +### lcd.print(‘text’, [x, y]) + +**位置(x,y)にテキストを表示します。** + +| パラメータ | 説明 | +| :--- | :--- | +| text | 表示するテキスト | +| x | テキストを表示する位置のx座標 | +| y | テキストを表示する位置のy座標 | + +**使用例** + +```python +lcd.print('this is a print text function', 80, 80) +``` + +--- + +### lcd.clear([color]) + +**デフォルトの背景色、または指定の色で画面を塗りつぶします。** + +| パラメータ | 説明 | +| :--- | :--- | +| color | 塗りつぶしの色 | + +**使用例** + +```python +lcd.clear(lcd.WHITE) +``` + +--- + +### 使い方 + +```python +from machine import SPI, Pin +from display import LCD + +spi = SPI(1, baudrate=32000000, mosi=Pin(23), miso=Pin(19), sck=Pin(18)) + +lcd = LCD(spi = spi) # lcd 初期化 +lcd.fillScreen(lcd.BLACK) # デフォルトの背景色を設定 + +lcd.drawLine(0, 0, lcd.WHITE) +lcd.drawTriangle(22, 22, 69, 98, 51, 22, lcd.RED) +lcd.fillTriangle(122, 122, 169, 198, 151, 182, lcd.RED) +lcd.drawCircle(180, 180, 10, lcd.BLUE) +lcd.fillcircle(100, 100, 10, lcd.BLUE) +lcd.drawRect(180, 12, 122, 10, lcd.BLUE) +lcd.fillRect(180, 30, 122, 10, lcd.BLUE) +lcd.drawRoundRect(180, 50, 122, 10, 4, lcd.BLUE) +lcd.fillRoundRect(180, 70, 122, 10, 4, lcd.BLUE) +lcd.print('this is a print text function', 80, 80) +``` diff --git a/docs/en/api_reference/api_speaker.md b/docs/ja/api_reference/micropython/api_speaker.md similarity index 65% rename from docs/en/api_reference/api_speaker.md rename to docs/ja/api_reference/micropython/api_speaker.md index 8936220a..d363f120 100644 --- a/docs/en/api_reference/api_speaker.md +++ b/docs/ja/api_reference/micropython/api_speaker.md @@ -1,5 +1,7 @@ # Speaker +[中文](/zh_CN/api_reference/micropython/api_speaker) | [English](/en/api_reference/micropython/api_speaker) | 日本語 + ### tone > M5.Speaker.tone(uint32_t freq); diff --git a/docs/en/api_reference/peripherals/api_gpio.md b/docs/ja/api_reference/micropython/peripherals/api_gpio.md similarity index 71% rename from docs/en/api_reference/peripherals/api_gpio.md rename to docs/ja/api_reference/micropython/peripherals/api_gpio.md index 76abbad3..ce910600 100644 --- a/docs/en/api_reference/peripherals/api_gpio.md +++ b/docs/ja/api_reference/micropython/peripherals/api_gpio.md @@ -1,5 +1,7 @@ # GPIO +[中文](/zh_CN/api_reference/micropython/peripherals/api_gpio) | [English](/en/api_reference/micropython/peripherals/api_gpio) | 日本語 + *Refer to GPIO API of [Arduino](http://www.arduino.cc)* ### digitalRead diff --git a/docs/ja/faq.md b/docs/ja/faq.md index b6e1808c..28940514 100644 --- a/docs/ja/faq.md +++ b/docs/ja/faq.md @@ -10,8 +10,8 @@ --- - Q. ArduinoでI2Cがうまく動きません。 - - A. ボードマネージャを利用して導入されるesp32ライブラリstable-1.0.0にはI2Cまわりにバグがあり、使用できない場合があります。最新のライブラリを[GitHub](https://github.com/espressif/arduino-esp32)より取得することで回避可能です。 - + - A. ~~ボードマネージャを利用して導入されるesp32ライブラリstable-1.0.0にはI2Cまわりにバグがあり、使用できない場合があります。最新のライブラリを[GitHub](https://github.com/espressif/arduino-esp32)より取得することで回避可能です。~~ボードマネージャから最新のesp32ライブラリ(>=1.0.1)を導入してください。 + --- - Q. UiFlowのソースは公開されていますか? diff --git a/docs/zh_CN/api_reference.md b/docs/zh_CN/api_reference.md index 9cd540ee..1146a529 100644 --- a/docs/zh_CN/api_reference.md +++ b/docs/zh_CN/api_reference.md @@ -4,7 +4,7 @@ *这是MicroPython的编程API* -## [LCD](zh_CN/api_reference/api_lcd) +## [LCD](zh_CN/api_reference/micropython/api_lcd) diff --git a/docs/zh_CN/api_reference/api_lcd.md b/docs/zh_CN/api_reference/micropython/api_lcd.md similarity index 96% rename from docs/zh_CN/api_reference/api_lcd.md rename to docs/zh_CN/api_reference/micropython/api_lcd.md index cf78ccd7..36187ec6 100644 --- a/docs/zh_CN/api_reference/api_lcd.md +++ b/docs/zh_CN/api_reference/micropython/api_lcd.md @@ -1,6 +1,6 @@ # LCD -中文 | [English](https://m5stack.github.io/m5-docs/#/en/api_reference/api_lcd) +中文 | [English](/en/api_reference/micropython/api_lcd) | [日本語](/ja/api_reference/micropython/api_lcd) ### lcd.setRotation(degree) @@ -24,7 +24,7 @@ lcd.setRotation(90) **例程** ```python lcd.setColor(lcd.RED) -lcd.setColor(lcd.ORANGE, LCD.DARKCYAN) +lcd.setColor(lcd.ORANGE, lcd.DARKCYAN) ``` **设置显示文本的前景颜色和背景颜色。** diff --git a/docs/zh_CN/api_reference/api_speaker.md b/docs/zh_CN/api_reference/micropython/api_speaker.md similarity index 65% rename from docs/zh_CN/api_reference/api_speaker.md rename to docs/zh_CN/api_reference/micropython/api_speaker.md index 0aea5190..9eece7cb 100644 --- a/docs/zh_CN/api_reference/api_speaker.md +++ b/docs/zh_CN/api_reference/micropython/api_speaker.md @@ -1,5 +1,7 @@ # Speaker +中文 | [English](/en/api_reference/micropython/api_speaker) | [日本語](/ja/api_reference/micropython/api_speaker) + ### tone > M5.Speaker.tone(uint32_t freq); diff --git a/docs/zh_CN/api_reference/peripherals/api_gpio.md b/docs/zh_CN/api_reference/micropython/peripherals/api_gpio.md similarity index 70% rename from docs/zh_CN/api_reference/peripherals/api_gpio.md rename to docs/zh_CN/api_reference/micropython/peripherals/api_gpio.md index 98112db5..58d1966d 100644 --- a/docs/zh_CN/api_reference/peripherals/api_gpio.md +++ b/docs/zh_CN/api_reference/micropython/peripherals/api_gpio.md @@ -1,5 +1,7 @@ # GPIO +中文 | [English](/en/api_reference/micropython/peripherals/api_gpio) | [日本語](/ja/api_reference/micropython/peripherals/api_gpio) + *使用Arduino库的GPIO API* ### digitalRead