diff --git a/en/peripherals/machine.Pin.md b/en/peripherals/machine.Pin.md index 9fd8a7a7456810847c07427198efe7ee94138f81..039ac887d82e48e898198f629ce3d5eb70737319 100644 --- a/en/peripherals/machine.Pin.md +++ b/en/peripherals/machine.Pin.md @@ -29,24 +29,17 @@ gpio1.get_dir() ### `machine.Pin` -
-
-
class machine.Pin(GPIOn, direction, pullMode, level)
-
-

参数描述:

- -
-
+```python +class machine.Pin(GPIOn, direction, pullMode, level) +``` + +**Parameter:** + +- `GPIOn` - Integer type. GPIO number. Click here to view the mapping relationship between GPIO pin numbers and physical pins. +- `direction` - Integer type. I/O mode. `IN` - Input mode. `OUT` - Output mode. +- `pullMode` - Integer type. Pull selection mode. Descriptions are as follows:
PULL_DISABLE - Floating mode
PULL_PU - Pull-up mode
PULL_PD - Pull-down mode +- `level` - Integer type. Pin level. `0` - Set pin to low level. `1`- Set pin to high level. + **Example:** ```python diff --git a/zh/peripherals/machine.Pin.md b/zh/peripherals/machine.Pin.md index ee4787854c6aab0f74d264c599c1794591c7f353..bf45b41febec3498aa9631ee9a35355aea67a3ea 100644 --- a/zh/peripherals/machine.Pin.md +++ b/zh/peripherals/machine.Pin.md @@ -29,24 +29,16 @@ gpio1.get_dir() ### `machine.Pin` -
-
-
class machine.Pin(GPIOn, direction, pullMode, level)
-
-

参数描述:

- -
-
+```python +class machine.Pin(GPIOn, direction, pullMode, level) +``` + +**参数描述:** + +- `GPIOn` - GPIO号,int类型,点此查看 GPIO引脚编号与物理引脚的映射关系。 +- `direction` - 输入输出模式,int类型,`IN` - 输入模式,`OUT` - 输出模式。 +- `pullMode` - 上下拉模式,int类型,说明如下:
PULL_DISABLE - 浮空模式
PULL_PU - 上拉模式
PULL_PD - 下拉模式 +- `level` - 引脚电平,int类型,`0` - 设置引脚为低电平, `1`- 设置引脚为高电平。 **示例:**