Skip to content

Commit cda363a

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

File tree

8 files changed

+12
-1
lines changed

8 files changed

+12
-1
lines changed

tests/pyb/accel.py

+2
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

+2
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

+2
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

+1
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

+1
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

+2
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

+1-1
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

+1
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)