diff options
author | Daniel Campora <daniel@wipy.io> | 2015-09-16 14:09:51 +0200 |
---|---|---|
committer | Daniel Campora <daniel@wipy.io> | 2015-09-21 22:30:32 +0200 |
commit | dffa9f6da65cd03e834b2ed3914f40428f72e49f (patch) | |
tree | 1f2e51f17c511f884db77e47d481c0f9c1b6bed2 /tests/wipy/i2c.py | |
parent | 660f8613fd8e38863998a9758d97eada0eebc47d (diff) | |
download | micropython-dffa9f6da65cd03e834b2ed3914f40428f72e49f.tar.gz micropython-dffa9f6da65cd03e834b2ed3914f40428f72e49f.zip |
cc3200: New SD and RTC API plus os and time modules' extensions.
Diffstat (limited to 'tests/wipy/i2c.py')
-rw-r--r-- | tests/wipy/i2c.py | 8 |
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 |