summaryrefslogtreecommitdiffstatshomepage
path: root/tests/wipy/i2c.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wipy/i2c.py')
-rw-r--r--tests/wipy/i2c.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/wipy/i2c.py b/tests/wipy/i2c.py
index 24afc5a082..b5f2a610d7 100644
--- a/tests/wipy/i2c.py
+++ b/tests/wipy/i2c.py
@@ -5,7 +5,7 @@ A MPU-9150 sensor must be connected to the I2C bus.
from pyb import I2C
import os
-import pyb
+import time
machine = os.uname().machine
if 'LaunchPad' in machine:
@@ -39,7 +39,7 @@ reg2_r = bytearray(2)
# reset the sensor
reg[0] |= 0x80
print(1 == i2c.writeto_mem(addr, 107, reg))
-pyb.delay(100) # wait for the sensor to reset...
+time.sleep_ms(100) # wait for the sensor to reset...
print(1 == i2c.readfrom_mem_into(addr, 107, reg)) # read the power management register 1
print(0x40 == reg[0])
@@ -79,7 +79,7 @@ print(0x40 == reg[0])
# reset the sensor
reg[0] |= 0x80
print(1 == i2c.writeto_mem(addr, 107, reg))
-pyb.delay(100) # wait for the sensor to reset...
+time.sleep_ms(100) # wait for the sensor to reset...
# now read and write two register at a time
print(2 == i2c.readfrom_mem_into(addr, 107, reg2))
@@ -97,7 +97,7 @@ print(reg2 == reg2_r)
# reset the sensor
reg[0] = 0x80
print(1 == i2c.writeto_mem(addr, 107, reg))
-pyb.delay(100) # wait for the sensor to reset...
+time.sleep_ms(100) # wait for the sensor to reset...
# try some raw read and writes
reg[0] = 117 # register address