LIS2DW12TR acceleration values not returned
I am using the Accel 10 click housing the LIS2DW12TR accelerometer and I want ot run it using a MicroPython program.The code is as follows:https://github.com/Yadnik1/Accel-10-i2c/blob/main/Accel10i2c.py .It does not detect the sensor and I am skeptical regarding the init function where I have to write to the registers to enable the accelerometer.
My init function is as follows:
def __init__(self,i2c,addr=device):
self.addr = addr
self.i2c = i2c
b = bytearray(1)
b[0] = 0
self.i2c.writeto_mem(0x64,0x20,b)
b[0] = 16
self.i2c.writeto_mem(0x04,0x25,b)
The function does the following things:
I2C.writeto_mem
(addr, memaddr, buf, *, addrsize=8)
Write buf to the slave specified by addr starting from the memory address specified by memaddr. The argument addrsize specifies the address size in bits (on ESP8266 this argument is not recognised and the address size is always 8 bits).
Can someone please tell me where I may be going wrong.
Datasheet of LIS2DW12TR:https://download.mikroe.com/documents/datasheets/lis2dw12_datasheet.pdf
