Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you may not be able to execute some actions.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
from pyb import Pin P0 = Pin('P0', Pin.OUT_PP, Pin.PULL_DOWN) print('P0=',P0.value()) P1 = Pin('P1', Pin.OUT_PP, Pin.PULL_UP) print('P1=',P1.value())
输出为P0= 0 P1= 0
原因:你的Pin设置的是输出模式。 解决办法:设置成输入模式。