Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

LSM9DS0 with BBB
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

LSM9DS0 with BBB

by van17061 on Mon Nov 07, 2016 1:10 am

Hi I'm a newbie with BBB.
I'm trying to use LSM9DSO 9-DOF IMU with BBB via I2C.
I've tried the i2cdetect and i2c = Adafruit_I2C(0x77) command from this guide: https://cdn-learn.adafruit.com/download ... -black.pdf. but both resulted in errors.
I have also found a library for LSM9DSO(https://github.com/projectzen/Beaglebone-LSM9DS0), but I have no idea how to use it.

I really appreciate any advice.
It's my first time here, so I apologize if anything in this post is inappropriate.

van17061
 
Posts: 3
Joined: Mon Nov 07, 2016 12:53 am

Re: LSM9DS0 with BBB

by drewfustini on Wed Nov 09, 2016 6:06 am

I've tried the i2cdetect and i2c = Adafruit_I2C(0x77) command from this guide. but both resulted in errors.

Please paste the exact error here or attach a screenshot.

drewfustini
 
Posts: 920
Joined: Sat Dec 26, 2015 1:19 pm

Re: LSM9DS0 with BBB

by van17061 on Thu Nov 10, 2016 4:30 am

Here are the error messages
>>> from Adafruit_I2C import Adafruit_I2C
>>> i2c = Adafruit_I2C(0x77)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/Adafruit_I2C.py", line 17, in __init__
self.bus = smbus.SMBus(busnum if busnum >= 0 else 1)
IOError: [Errno 2] No such file or directory

I made some mistake for i2cdetect, now I can probe i2c2. the results are as follow
ubuntu@ubuntu-armhf:~$ sudo i2cdetect -r -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- 1d -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- 6b -- -- -- --
70: -- -- -- -- -- -- -- --


Really appreciate your attention :)

van17061
 
Posts: 3
Joined: Mon Nov 07, 2016 12:53 am

Re: LSM9DS0 with BBB

by drewfustini on Fri Nov 11, 2016 1:54 am

Is this the sensor that you have?

Adafruit 9-DOF Accel/Mag/Gyro+Temp Breakout Board - LSM9DS0
PRODUCT ID: 2021

It is important to determine what the I2C addresses are for that sensor. From the Arduino library for the breakout board:
Adafruit_LSM9DS0_Library/blob/master/Adafruit_LSM9DS0.h
#define LSM9DS0_ADDRESS_ACCELMAG (0x1D) // 3B >> 1 = 7bit default
#define LSM9DS0_ADDRESS_GYRO (0x6B) // D6 >> 1 = 7bit default


It does appear that the sensor is wired to your BeagleBone correctly based on the output of sudo i2cdetect -r -y 2.

You'll need to use the argument of 0x1D or 0x6B for Adafruit_I2C().

drewfustini
 
Posts: 920
Joined: Sat Dec 26, 2015 1:19 pm

Re: LSM9DS0 with BBB

by van17061 on Sun Nov 13, 2016 11:25 pm

Yes, I exactly have the sensor you mentioned.

Thank you so much drewfustini, I will try using the address !

van17061
 
Posts: 3
Joined: Mon Nov 07, 2016 12:53 am

Please be positive and constructive with your questions and comments.