Skip to content

Commit 9fd4345

Browse files
committed
mpu wip
1 parent 393e2c7 commit 9fd4345

File tree

2 files changed

+4
-57
lines changed

2 files changed

+4
-57
lines changed

lsm9ds1.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import spidev
66
import threading
77

8-
from smbus2 import SMBusWrapper
8+
from smbus2 import SMBus
99

1010
MAX_INVALID_MAG = 99.0
1111

@@ -154,16 +154,16 @@ def __init__(self, port, i2c_address, data_ready_pin=None):
154154
self.data_ready_interrupt = None
155155

156156
def write_byte(self, address, value):
157-
with SMBusWrapper(self.port) as bus:
157+
with SMBus(self.port) as bus:
158158
bus.write_byte_data(self.i2c_device, address, value)
159159

160160
def read_byte(self, address):
161-
with SMBusWrapper(self.port) as bus:
161+
with SMBus(self.port) as bus:
162162
bus.write_byte(self.i2c_device, address)
163163
return bus.read_byte(self.i2c_device)
164164

165165
def read_bytes(self, address, length):
166-
with SMBusWrapper(self.port) as bus:
166+
with SMBus(self.port) as bus:
167167
bus.write_byte(self.i2c_device, address)
168168
result = bus.read_i2c_block_data(self.i2c_device, address, length)
169169
return result

mpu3.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)