diff options
author | Damien George <damien.p.george@gmail.com> | 2014-08-08 22:38:58 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-08-08 22:38:58 +0100 |
commit | b92e7533d3b40fd5129982370f177f47b2790df8 (patch) | |
tree | 586fae07925581402aa6f5dc22a6d290cc10d90b | |
parent | 284efa89ae25f75686754f0b6b8fd06526c05971 (diff) | |
download | micropython-b92e7533d3b40fd5129982370f177f47b2790df8.tar.gz micropython-b92e7533d3b40fd5129982370f177f47b2790df8.zip |
tests, pyb: Update pin test.
-rw-r--r-- | tests/pyb/pin.py | 10 | ||||
-rw-r--r-- | tests/pyb/pin.py.exp | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/pyb/pin.py b/tests/pyb/pin.py index 448ce53998..b3eb87b608 100644 --- a/tests/pyb/pin.py +++ b/tests/pyb/pin.py @@ -1,17 +1,21 @@ from pyb import Pin -p = Pin('X1') +p = Pin('X1', Pin.IN) print(p) print(p.name()) print(p.pin()) print(p.port()) p = Pin('X1', Pin.IN, Pin.PULL_UP) -#p = Pin('X1', Pin.IN, pull=Pin.PULL_UP) +p = Pin('X1', Pin.IN, pull=Pin.PULL_UP) +p = Pin('X1', mode=Pin.IN, pull=Pin.PULL_UP) +print(p) print(p.value()) p.init(p.IN, p.PULL_DOWN) -#p.init(p.IN, pull=p.PULL_DOWN) +p.init(p.IN, pull=p.PULL_DOWN) +p.init(mode=p.IN, pull=p.PULL_DOWN) +print(p) print(p.value()) p.init(p.OUT_PP) diff --git a/tests/pyb/pin.py.exp b/tests/pyb/pin.py.exp index 4856f5b8e7..599374600a 100644 --- a/tests/pyb/pin.py.exp +++ b/tests/pyb/pin.py.exp @@ -1,8 +1,10 @@ -<Pin A0> +Pin(Pin.cpu.A0, mode=Pin.IN) A0 0 0 +Pin(Pin.cpu.A0, mode=Pin.IN, pull=Pin.PULL_UP) 1 +Pin(Pin.cpu.A0, mode=Pin.IN, pull=Pin.PULL_DOWN) 0 0 1 |