0
\$\begingroup\$

I have barely any knowledge in this area, the most I have done is used my RPi3 with pre-built python libraries for sensors such as ADS1115 so I didn't have to go through the process of understanding the nut and bolts of communicating with the device.

I am trying to use a accel/gyro (choice based on performance, needed something good). I am attempting to decipher how to communicate with the device using i2c on my RPi..it may as well be in another language.

I am hoping someone would be so kind as to give me some pointers / potentially help me develop my code to read the accel/gyro values.

For specifics: I want to read the accel at 16g, the gyro at 2000dps, both at 6664Hz..any filters or anything to improve the accuracy would also be good

datasheet

Based on tutorials/i2c python doc, I would imagine the code would go something like:

import smbus
i2c_ch = 1
i2c_address = ?x?? #whatever comes up when I detect the i2c address after connecting SDA/SCL wires
bus = smbus.SMBus(i2c_ch)
reg_accel = ? #need help
reg_gyro = ? #need help
reg_config = ? #need help
bus.write_i2c_block_data(i2c_address, reg_config, ?) #send commands to config to get the desired operating characteristics

accel = bus.read_i2c_block_data(i2c_address, reg_accel, ?) #read raw accel data
gyro = bus.read_i2c_block_data(i2c_address, reg_gyro, ?) #read raw gyro data

Please someone help me!! Not my area of expertise

\$\endgroup\$
3
  • \$\begingroup\$ github.com/stm32duino/LSM6DSL just googled it. Give a try to understand \$\endgroup\$
    – User323693
    Jul 26, 2019 at 3:41
  • \$\begingroup\$ thanks, I somehow missed this, I will attempt to extract the info I need to implement my code in python \$\endgroup\$
    – Derek Eden
    Jul 26, 2019 at 3:43
  • \$\begingroup\$ I came across the intel UPM repo that has high level APIs for many common sensors, including the one I am interested in : github.com/intel-iot-devkit/upm/tree/master/examples/python though it appears to be a mission to install, I think this will be my best bet \$\endgroup\$
    – Derek Eden
    Jul 27, 2019 at 2:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.