Skip to content
Snippets Groups Projects
Commit b92e7533 authored by Damien George's avatar Damien George
Browse files

tests, pyb: Update pin test.

parent 284efa89
No related branches found
No related tags found
No related merge requests found
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)
......
<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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment