diff --git a/en/peripherals/machine.Pin.md b/en/peripherals/machine.Pin.md index 966597bd83c991e48be13b2c9eedd55adbdf782e..652f01e3130d17bd59437cc5391eaa8c56698156 100644 --- a/en/peripherals/machine.Pin.md +++ b/en/peripherals/machine.Pin.md @@ -3562,6 +3562,13 @@ class machine.Pin(GPIOn, direction, pullMode, level)

2.GPIO27, GPIO39, and GPIO40 have weak driving capabilities, so it is recommended to use them only as input pins

+ +
+
+

Note:

+

1.Pin37-GPIO11,Pin38-GPIO12,Pin39-GPIO13,Module that support GNSS function do not enable the multiplexing function of this pin and it need to be left open.

+
+
@@ -3603,11 +3610,14 @@ This method sets the pin level. ```python >>> from machine import Pin +#GPIO Output Mode - Set Pin Level >>> gpio1 = Pin(Pin.GPIO1, Pin.OUT, Pin.PULL_DISABLE, 0) >>> gpio1.write(1) 0 +# GPIO Input Mode - Reading Pin Level +>>> gpio1 = Pin(Pin.GPIO1, Pin.IN, Pin.PULL_DISABLE, 0) >>> gpio1.read() -1 +0 ``` ### `Pin.set_dir` diff --git a/zh/peripherals/machine.Pin.md b/zh/peripherals/machine.Pin.md index aa44523ae61bf5b8675d0f947c39ef393ce08c41..b116aee4349f0c748489bf8a29a6eb69f67fa07a 100644 --- a/zh/peripherals/machine.Pin.md +++ b/zh/peripherals/machine.Pin.md @@ -3562,6 +3562,13 @@ class machine.Pin(GPIOn, direction, pullMode, level)

2.GPIO27、GPIO39、GPIO40驱动能力较弱,建议仅做输入引脚使用

+ +
+
+

注:

+

1.Pin37-GPIO11,Pin38-GPIO12,Pin39-GPIO13,支持GNSS的模块不会启用此引脚的复用功能,因此该引脚需要保持处于断开状态。

+
+
## 方法 @@ -3600,11 +3607,14 @@ Pin.write(value) ```python >>> from machine import Pin +#GPIO输出模式 设置引脚电平 >>> gpio1 = Pin(Pin.GPIO1, Pin.OUT, Pin.PULL_DISABLE, 0) >>> gpio1.write(1) 0 +#GPIO输入模式 读取引脚电平 +>>> gpio1 = Pin(Pin.GPIO1, Pin.IN, Pin.PULL_DISABLE, 0) >>> gpio1.read() -1 +0 ``` ### `Pin.set_dir`