summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/pyb/accel.py2
-rw-r--r--tests/pyb/dac.py2
-rw-r--r--tests/pyb/extint.py2
-rw-r--r--tests/pyb/i2c.py1
-rw-r--r--tests/pyb/led.py1
-rw-r--r--tests/pyb/rtc.py2
-rw-r--r--tests/pyb/switch.py2
-rw-r--r--tests/pyb/timer.py1
8 files changed, 12 insertions, 1 deletions
diff --git a/tests/pyb/accel.py b/tests/pyb/accel.py
index 13f53b33c..e5a1a2ed7 100644
--- a/tests/pyb/accel.py
+++ b/tests/pyb/accel.py
@@ -1,3 +1,5 @@
+import pyb
+
accel = pyb.Accel()
print(accel)
accel.x()
diff --git a/tests/pyb/dac.py b/tests/pyb/dac.py
index 61ab7bd6e..884ec5829 100644
--- a/tests/pyb/dac.py
+++ b/tests/pyb/dac.py
@@ -1,3 +1,5 @@
+import pyb
+
dac = pyb.DAC(1)
print(dac)
dac.noise(100)
diff --git a/tests/pyb/extint.py b/tests/pyb/extint.py
index 20648995b..47d84c8b5 100644
--- a/tests/pyb/extint.py
+++ b/tests/pyb/extint.py
@@ -1,3 +1,5 @@
+import pyb
+
ext = pyb.ExtInt('X1', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))
ext.disable()
ext.enable()
diff --git a/tests/pyb/i2c.py b/tests/pyb/i2c.py
index 79169d055..1f88c8e97 100644
--- a/tests/pyb/i2c.py
+++ b/tests/pyb/i2c.py
@@ -1,3 +1,4 @@
+import pyb
from pyb import I2C
i2c = I2C(1)
diff --git a/tests/pyb/led.py b/tests/pyb/led.py
index a727c90df..9f5ccdf7a 100644
--- a/tests/pyb/led.py
+++ b/tests/pyb/led.py
@@ -1,3 +1,4 @@
+import pyb
from pyb import LED
for i in range(4):
diff --git a/tests/pyb/rtc.py b/tests/pyb/rtc.py
index ac716b27f..853aa7957 100644
--- a/tests/pyb/rtc.py
+++ b/tests/pyb/rtc.py
@@ -1,4 +1,6 @@
+import pyb
from pyb import RTC
+
rtc = RTC()
print(rtc)
rtc.datetime((2014, 1, 1, 1, 0, 0, 0, 0))
diff --git a/tests/pyb/switch.py b/tests/pyb/switch.py
index 4b74e0fd7..7c44adb13 100644
--- a/tests/pyb/switch.py
+++ b/tests/pyb/switch.py
@@ -1,6 +1,6 @@
from pyb import Switch
-sw = pyb.Switch()
+sw = Switch()
print(sw())
sw.callback(print)
sw.callback(None)
diff --git a/tests/pyb/timer.py b/tests/pyb/timer.py
index ff1bda0f2..45cb8550d 100644
--- a/tests/pyb/timer.py
+++ b/tests/pyb/timer.py
@@ -1,3 +1,4 @@
+import pyb
from pyb import Timer
tim = Timer(4)