diff --git a/docs/API_reference/en/medialib/qrcode.md b/docs/API_reference/en/medialib/qrcode.md index f5d0ae4ce337e133e65a6b6530acb031b6d83ef2..f2f387de52ce7f0d4455800137ed6cbc7ab75aa3 100644 --- a/docs/API_reference/en/medialib/qrcode.md +++ b/docs/API_reference/en/medialib/qrcode.md @@ -7,7 +7,7 @@ Feature introduction: generate a corresponding QR code according to the input co ### `qrcode.show` ```python -qrcode.show(qrcode_str,magnification,start_x,start_y,Background_color,Foreground_color) +qrcode.show(qrcode_str,magnification,start_x,start_y,Background_color,Foreground_color,rotate) ``` Displays QR codes to LCD. @@ -20,6 +20,7 @@ Displays QR codes to LCD. - `start_y` - Integer type. The start y coordinate of the displayed QR code. - `Background_color` - Integer type. Background color. Default value: 0xffff. - `Foreground_color` - Integer type. Foreground color. Default value: 0x0000. +- `rotate`-Integer type.Clockwise rotation angle.[Go refer to constants](#Constant), Default value: 0. **Return Value** @@ -29,4 +30,23 @@ Displays QR codes to LCD. `-2` - Magnification failed -`-3` - Display failed \ No newline at end of file +`-3` - Display failed + +示例: + +```python +''' +To use qrcode, the LCD needs to be initialized first +''' +import qrcode +qrcode.show("https://python.quectel.com/en",6,10,10,0xffff,0x0000,qrcode.ROTATE_0) +``` + +## Constant + +| Constant | Value | **Explanation** | +| ----------------- | ----- | ----------------------------- | +| qrcode.ROTATE_0 | 0 | Do not rotate (default value) | +| qrcode.ROTATE_90 | 1 | Rotate clockwise 90 degrees | +| qrcode.ROTATE_180 | 2 | Rotate clockwise 180 degrees | +| qrcode.ROTATE_270 | 3 | Rotate clockwise 270 degrees | \ No newline at end of file diff --git a/docs/API_reference/zh/medialib/qrcode.md b/docs/API_reference/zh/medialib/qrcode.md index bd505e5bc41c5513dfe2fb39e9e0e62f6e8258d3..a47aa0ab330bbe7df7ddde58915447526c1e6eed 100644 --- a/docs/API_reference/zh/medialib/qrcode.md +++ b/docs/API_reference/zh/medialib/qrcode.md @@ -9,7 +9,7 @@ ### `qrcode.show` ```python -qrcode.show(qrcode_str,magnification,start_x,start_y,Background_color,Foreground_color) +qrcode.show(qrcode_str,magnification,start_x,start_y,Background_color,Foreground_color,rotate) ``` 显示二维码到LCD。 @@ -22,7 +22,30 @@ qrcode.show(qrcode_str,magnification,start_x,start_y,Background_color,Foreground - `start_y`-int类型,二维码显示起始y坐标; - `Background_color`-int类型,前景色(不设置即默认为0xffff); - `Foreground_color`-int类型,背景色(不设置即默认为0x0000)。 +- `rotate`-int类型,顺时针旋转角度,[见常量](#常量)(不设置即默认为0)。 **返回值描述:** `0`表示成功,`-1`表示生成二维码失败,`-2`表示放大失败,`-3`表示显示失败。 + +**Example:** + +```python +''' +使用qrcode需先初始化LCD +''' +import qrcode +qrcode.show("https://python.quectel.com",6,10,10,0xffff,0x0000,qrcode.ROTATE_0) +``` + + + +## 常量 + +| **常量** | **值** | **说明** | +| ----------------- | ------ | ------------------- | +| qrcode.ROTATE_0 | 0 | 不旋转(默认值) | +| qrcode.ROTATE_90 | 1 | 顺时针旋转90度显示 | +| qrcode.ROTATE_180 | 2 | 顺时针旋转180度显示 | +| qrcode.ROTATE_270 | 3 | 顺时针旋转270度显示 | +