add ja lcd api reference

This commit is contained in:
塩入孔章
2018-12-04 15:00:14 +08:00
parent c087b2c814
commit fb7b079a79
14 changed files with 268 additions and 85 deletions
+1 -1
View File
@@ -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)
<!-- ## [Peripherals](en/api_reference/peripherals/api_gpio)
### 1. [GPIO](en/api_reference/peripherals/api_gpio)
## [Speaker](en/api_reference/api_speaker) -->
@@ -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)
### <mark>lcd.setRotation(degree)</mark>
@@ -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.**
@@ -1,5 +1,7 @@
# Speaker
[中文](/zh_CN/api_reference/micropython/api_speaker) | English | [日本語](/ja/api_reference/micropython/api_speaker)
### <mark>tone</mark>
> M5.Speaker.tone(uint32_t freq);
@@ -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)*
### <mark>digitalRead</mark>
+3 -4
View File
@@ -2,7 +2,6 @@
[中文](/zh_CN/api_reference) | [English](/en/api_reference) | 日本語
<!-- ## [LCD](ja/api_reference/api_lcd)
## [Peripherals](ja/api_reference/peripherals/api_gpio)
### 1. [GPIO](ja/api_reference/peripherals/api_gpio)
## [Speaker](ja/api_reference/api_speaker) -->
| MicroPython | Arduino |
|:------------|:--------|
|[LCD](ja/api_reference/micropython/api_lcd) | / |
-73
View File
@@ -1,73 +0,0 @@
# LCD
### <mark>setbrightness</mark>
> M5.Lcd.setbrightness(uint8_t brightness);
Set the brightness of LCD.
| Param | Type | Description |
| --- | --- | --- |
| brightness | <code>uint8_t</code> | brightness(0-254) |
**Example**
```c++
M5.Lcd.setbrightness(100);
```
* * *
### <mark>fillScreen</mark>
> M5.Lcd.fillScreen(uint16_t color);
Set the color to display of the whole LCD.
| Param | Type | Description |
| --- | --- | --- |
| color | <code>uint16_t</code> | color value |
**Example**
```c++
M5.Lcd.fillScreen(RED);
delay(500);
M5.Lcd.fillScreen(WHITE);
delay(500);
```
* * *
### <mark>fillRect</mark>
> 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 | <code>int16_t</code> | offset of x, y direction |
| w, h | <code>int16_t</code> | width and height of graphics |
| color | <code>uint16_t</code> | color to fill |
**Example**
```c++
M5.Lcd.fillRect(50,50,60,150,WHITE);
```
* * *
### <mark>fillRoundRect</mark>
> 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 | <code>int16_t</code> | offset of x, y direction |
| w, h | <code>int16_t</code> | width and height of graphics |
| radius | <code>int16_t</code> | fillet radius |
| color | <code>uint16_t</code> | color to fill |
**Example**
```c++
M5.Lcd.fillRoundRect(50,50,60,150,4,WHITE);
```
* * *
@@ -0,0 +1,245 @@
# LCD
[中文](/zh_CN/api_reference/micropython/api_lcd) | [English](/en/api_reference/micropython/api_lcd) | 日本語
### <mark>lcd.setRotation(degree)</mark>
**画面全体の回転角度を設定します。**
| パラメータ | 説明 |
|:---|:---|
| degree | 回転角度 |
**使用例**
```python
lcd.setRotation(90)
```
---
### <mark>lcd.setColor(color [, background_color])</mark>
**テキストの色と背景色を設定します。**
| パラメータ | 説明 |
| :--- | :--- |
| color | テキストの色 |
| background_color| テキストの背景色 |
**使用例**
```python
lcd.setColor(lcd.RED)
lcd.setColor(lcd.ORANGE, lcd.DARKCYAN)
```
---
### <mark>lcd.fillScreen(color)</mark>
**画面全体を指定した色で塗りつぶします。**
| パラメータ | 説明 |
|:--- | :--- |
| color | 塗りつぶしの色 |
**使用例**
```python
lcd.fillScreen(lcd.RED)
```
---
### <mark>lcd.drawPixel(x, y [,color])</mark>
**(x,y)の位置に点(ピクセル)を描画します。**
*色の指定がない場合は、現在設定されている前景色が使用されます。*
| パラメータ | 説明 |
| :--- | :--- |
| x | 点のx座標 |
| y | 点のy座標 |
| color | 点の色 |
**使用例**
```python
lcd.drawPixel(22, 22, lcd.RED)
```
---
### <mark>lcd.drawLine(x, y, x1, y1 [,color])</mark>
**点(x,y) から 点(x1,y1) へ直線を描画します。**
*色の指定がない場合は、現在設定されている前景色が使用されます。*
| パラメータ | 説明 |
| :--- | :--- |
| x | 線の始点のx座標 |
| y | 線の始点のy座標 |
| x1 | 線の終点のx1座標 |
| y1 | 線の終点のy1座標 |
| color | 線の色 |
**使用例**
```python
lcd.drawLine(0, 0, 12, 12, lcd.WHITE)
```
---
### <mark>lcd.drawTriangle(x, y, x1, y1, x2, y2 [,color])</mark>
**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)
```
---
### <mark>lcd.fillTriangle(x, y, x1, y1, x2, y2 [,color])</mark>
**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)
```
---
### <mark>lcd.drawRect(x, y, w, h, [,color])</mark>
**左上の点(x,y)と幅と高さを指定して、四角形を描画します。**
*色の指定がない場合は、現在設定されている前景色が使用されます。*
| パラメータ | 説明 |
| :--- | :--- |
| x | 四角形の左上の頂点のx座標 |
| y | 四角形の左上の頂点のy座標 |
| w | 四角形の幅 |
| h | 四角形の高さ |
| color | 四角形の線の色 |
**使用例**
```python
lcd.drawRect(180, 12, 122, 10, lcd.BLUE)
```
---
### <mark>lcd.drawRoundRect(x, y, w, h, r [,color])</mark>
**左上の点(x,y)と幅と高さを指定して、かど丸の四角形を描画します。**
*色の指定がない場合は、現在設定されている前景色が使用されます。*
| パラメータ | 説明 |
| :--- | :--- |
| x | 四角形の左上の頂点のx座標 |
| y | 四角形の左上の頂点のy座標 |
| w | 四角形の幅 |
| h | 四角形の高さ |
| r | コーナー半径 |
| color | 四角形の線の色 |
**使用例**
```python
lcd.fillRoundRect(180, 70, 122, 10, 4, lcd.BLUE)
```
---
### <mark>lcd.print(text, [x, y])</mark>
**位置(x,y)にテキストを表示します。**
| パラメータ | 説明 |
| :--- | :--- |
| text | 表示するテキスト |
| x | テキストを表示する位置のx座標 |
| y | テキストを表示する位置のy座標 |
**使用例**
```python
lcd.print('this is a print text function', 80, 80)
```
---
### <mark>lcd.clear([color])</mark>
**デフォルトの背景色、または指定の色で画面を塗りつぶします。**
| パラメータ | 説明 |
| :--- | :--- |
| 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)
```
@@ -1,5 +1,7 @@
# Speaker
[中文](/zh_CN/api_reference/micropython/api_speaker) | [English](/en/api_reference/micropython/api_speaker) | 日本語
### <mark>tone</mark>
> M5.Speaker.tone(uint32_t freq);
@@ -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)*
### <mark>digitalRead</mark>
+2 -2
View File
@@ -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のソースは公開されていますか?
+1 -1
View File
@@ -4,7 +4,7 @@
*这是MicroPython的编程API*
## [LCD](zh_CN/api_reference/api_lcd)
## [LCD](zh_CN/api_reference/micropython/api_lcd)
<!-- ## [Peripherals](zh_CN/api_reference/peripherals/api_gpio)
### 1. [GPIO](zh_CN/api_reference/peripherals/api_gpio)
## [Speaker](zh_CN/api_reference/api_speaker) -->
@@ -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)
### <mark>lcd.setRotation(degree)</mark>
@@ -24,7 +24,7 @@ lcd.setRotation(90)
**例程**
```python
lcd.setColor(lcd.RED)
lcd.setColor(lcd.ORANGE, LCD.DARKCYAN)
lcd.setColor(lcd.ORANGE, lcd.DARKCYAN)
```
**设置显示文本的前景颜色和背景颜色。**
@@ -1,5 +1,7 @@
# Speaker
中文 | [English](/en/api_reference/micropython/api_speaker) | [日本語](/ja/api_reference/micropython/api_speaker)
### <mark>tone</mark>
> M5.Speaker.tone(uint32_t freq);
@@ -1,5 +1,7 @@
# GPIO
中文 | [English](/en/api_reference/micropython/peripherals/api_gpio) | [日本語](/ja/api_reference/micropython/peripherals/api_gpio)
*使用Arduino库的GPIO API*
### <mark>digitalRead</mark>