Skip to content

Commit b92e753

Browse files
committed
tests, pyb: Update pin test.
1 parent 284efa8 commit b92e753

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

tests/pyb/pin.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
from pyb import Pin
22

3-
p = Pin('X1')
3+
p = Pin('X1', Pin.IN)
44
print(p)
55
print(p.name())
66
print(p.pin())
77
print(p.port())
88

99
p = Pin('X1', Pin.IN, Pin.PULL_UP)
10-
#p = Pin('X1', Pin.IN, pull=Pin.PULL_UP)
10+
p = Pin('X1', Pin.IN, pull=Pin.PULL_UP)
11+
p = Pin('X1', mode=Pin.IN, pull=Pin.PULL_UP)
12+
print(p)
1113
print(p.value())
1214

1315
p.init(p.IN, p.PULL_DOWN)
14-
#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+
print(p)
1519
print(p.value())
1620

1721
p.init(p.OUT_PP)

tests/pyb/pin.py.exp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
<Pin A0>
1+
Pin(Pin.cpu.A0, mode=Pin.IN)
22
A0
33
0
44
0
5+
Pin(Pin.cpu.A0, mode=Pin.IN, pull=Pin.PULL_UP)
56
1
7+
Pin(Pin.cpu.A0, mode=Pin.IN, pull=Pin.PULL_DOWN)
68
0
79
0
810
1

0 commit comments

Comments
 (0)