summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-05-04 12:40:51 +0100
committerDamien George <damien.p.george@gmail.com>2014-05-04 12:40:51 +0100
commitcda363a036f550707ed48d94e1be3ad54dda90b6 (patch)
tree1719b19ce5a3a1fa191ad1ecfe8a49082f05ad5f
parentc327c0de5d7a07cc0afa2fbad5aa33f59d90aad0 (diff)
downloadmicropython-cda363a036f550707ed48d94e1be3ad54dda90b6.tar.gz
micropython-cda363a036f550707ed48d94e1be3ad54dda90b6.zip
tests, pyb: Add 'import pyb' when needed.
-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 13f53b33c0..e5a1a2ed7a 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 61ab7bd6e6..884ec58296 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 20648995bc..47d84c8b5e 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 79169d0553..1f88c8e975 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 a727c90dfa..9f5ccdf7a9 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 ac716b27fc..853aa79577 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 4b74e0fd73..7c44adb136 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 ff1bda0f23..45cb8550dc 100644
--- a/tests/pyb/timer.py
+++ b/tests/pyb/timer.py
@@ -1,3 +1,4 @@
+import pyb
from pyb import Timer
tim = Timer(4)