We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 284efa8 commit b92e753Copy full SHA for b92e753
2 files changed
tests/pyb/pin.py
@@ -1,17 +1,21 @@
1
from pyb import Pin
2
3
-p = Pin('X1')
+p = Pin('X1', Pin.IN)
4
print(p)
5
print(p.name())
6
print(p.pin())
7
print(p.port())
8
9
p = Pin('X1', Pin.IN, Pin.PULL_UP)
10
-#p = Pin('X1', Pin.IN, pull=Pin.PULL_UP)
+p = Pin('X1', Pin.IN, pull=Pin.PULL_UP)
11
+p = Pin('X1', mode=Pin.IN, pull=Pin.PULL_UP)
12
+print(p)
13
print(p.value())
14
15
p.init(p.IN, p.PULL_DOWN)
-#p.init(p.IN, pull=p.PULL_DOWN)
16
+p.init(p.IN, pull=p.PULL_DOWN)
17
+p.init(mode=p.IN, pull=p.PULL_DOWN)
18
19
20
21
p.init(p.OUT_PP)
tests/pyb/pin.py.exp
@@ -1,8 +1,10 @@
-<Pin A0>
+Pin(Pin.cpu.A0, mode=Pin.IN)
A0
0
+Pin(Pin.cpu.A0, mode=Pin.IN, pull=Pin.PULL_UP)
+Pin(Pin.cpu.A0, mode=Pin.IN, pull=Pin.PULL_DOWN)
0 commit comments