I am using the nrf52840 TWI driver to manipulate an accelerometer (LIS2DE12).
How can the TWI API be used for reading and writing registers on a slave device?
Any examples will be appreciated!
I am using the nrf52840 TWI driver to manipulate an accelerometer (LIS2DE12).
How can the TWI API be used for reading and writing registers on a slave device?
Any examples will be appreciated!
Hello,
You can use TWI if the accelerometer supports this. There are a lot of questions on this forum regarding the LIS2DE12:
https://devzone.nordicsemi.com/search?q=LIS2DE12
You must read the datasheet to see what commands you need to send to the sensor. Unfortunately, I don't have this sensor, so I can't test it myself, but you should check out the other posts regarding this accelerometer on the forum.
It is discussed amongst other threads here:
https://devzone.nordicsemi.com/f/nordic-q-a/23104/accelerometer_result_error/90909#90909
Best regards,
Edvin