mirror of
https://github.com/supleed2/ELEC60013-ES-CW1.git
synced 2024-12-23 05:55:49 +00:00
Update lis3dh.py
This commit is contained in:
parent
c881e589fb
commit
39b971a3c6
|
@ -65,8 +65,8 @@ class lis3dh:
|
||||||
prepare_x = smbus2.i2c_msg.write(self.addr, [0x28])
|
prepare_x = smbus2.i2c_msg.write(self.addr, [0x28])
|
||||||
prepare_y = smbus2.i2c_msg.write(self.addr, [0x2A])
|
prepare_y = smbus2.i2c_msg.write(self.addr, [0x2A])
|
||||||
prepare_z = smbus2.i2c_msg.write(self.addr, [0x2C])
|
prepare_z = smbus2.i2c_msg.write(self.addr, [0x2C])
|
||||||
read_status = smbus2.i2c_msg.read(self.addr, 1)
|
status = smbus2.i2c_msg.read(self.addr, 1)
|
||||||
self.i2c.i2c_rdwr(check_status, read_status)
|
self.i2c.i2c_rdwr(check_status, status)
|
||||||
#while status.buf[0] != 0b1111:
|
#while status.buf[0] != 0b1111:
|
||||||
# sleep(0.00001)
|
# sleep(0.00001)
|
||||||
self.i2c.i2c_rdwr(prepare_x, x, prepare_y, y, prepare_z, z)
|
self.i2c.i2c_rdwr(prepare_x, x, prepare_y, y, prepare_z, z)
|
||||||
|
|
Loading…
Reference in a new issue