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
4f7c676e53
commit
735cac7768
|
@ -65,8 +65,9 @@ class lis3dh:
|
||||||
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)
|
read_status = smbus2.i2c_msg.read(self.addr, 1)
|
||||||
status = self.i2c.i2c_rdwr(check_status, read_status)
|
status = self.i2c.i2c_rdwr(check_status, read_status)
|
||||||
while status.buf[0] != 0b1111:
|
#while status.buf[0] != 0b1111:
|
||||||
sleep(0.00001)
|
# sleep(0.00001)
|
||||||
|
print(status)
|
||||||
x = self.i2c.i2c_rdwr(prepare_x, read_axis)
|
x = self.i2c.i2c_rdwr(prepare_x, read_axis)
|
||||||
y = self.i2c.i2c_rdwr(prepare_y, read_axis)
|
y = self.i2c.i2c_rdwr(prepare_y, read_axis)
|
||||||
z = self.i2c.i2c_rdwr(prepare_z, read_axis)
|
z = self.i2c.i2c_rdwr(prepare_z, read_axis)
|
||||||
|
|
Loading…
Reference in a new issue