Skip to content

Commit cda363a

Browse files
committed
tests, pyb: Add 'import pyb' when needed.
1 parent c327c0d commit cda363a

8 files changed

Lines changed: 12 additions & 1 deletion

File tree

tests/pyb/accel.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import pyb
2+
13
accel = pyb.Accel()
24
print(accel)
35
accel.x()

tests/pyb/dac.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import pyb
2+
13
dac = pyb.DAC(1)
24
print(dac)
35
dac.noise(100)

tests/pyb/extint.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import pyb
2+
13
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
24
ext.disable()
35
ext.enable()

tests/pyb/i2c.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import pyb
12
from pyb import I2C
23

34
i2c = I2C(1)

tests/pyb/led.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import pyb
12
from pyb import LED
23

34
for i in range(4):

tests/pyb/rtc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import pyb
12
from pyb import RTC
3+
24
rtc = RTC()
35
print(rtc)
46
rtc.datetime((2014, 1, 1, 1, 0, 0, 0, 0))

tests/pyb/switch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pyb import Switch
22

3-
sw = pyb.Switch()
3+
sw = Switch()
44
print(sw())
55
sw.callback(print)
66
sw.callback(None)

tests/pyb/timer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import pyb
12
from pyb import Timer
23

34
tim = Timer(4)

0 commit comments

Comments
 (0)