On Thursday, January 4, 2018 at 8:37:33 AM UTC-6, Graham wrote: > > I suspect your code is looking for it on the wrong bus number. > > You did not include your driver code. > > Look there. > > The part is obviously sitting on Bus 2. > > I have seen drivers that default to bus 1, unless overridden. > > --- Graham > > == > > On Wednesday, January 3, 2018 at 10:13:43 PM UTC-6, Tomas Medina wrote: >> >> I believe it's 2 >> >> On Wednesday, January 3, 2018 at 10:07:29 PM UTC-5, RobertCNelson wrote: >>> >>> >>> >>> On Wed, Jan 3, 2018 at 8:54 PM, Tomas Medina <[email protected]> wrote: >>> >>>> >>>> I am trying to use a Beaglebone Wireless (debian image 2017-07-01) to >>>> read values from an HMC5883L Magnetometer. >>>> The device is connected through I2C2 (pins P9_19 and P9_20). The >>>> address for the device is 0x68. >>>> >>>> I know the device is connected since I can see it by using i2cdetect as >>>> shown below: >>>> >>>> However, whenever I run my python code to read the values, I get >>>> messages that the bone is having errors accessing the adresses. >>>> As with most of my problems with the BBBW, the code works fine on an >>>> older bone (debian image 2015-11-12). >>>> My faith in Beagleboard dwindles by the minute. >>>> >>>> Here is the python code, first is my main file: >>>> from time import sleep >>>> import os >>>> import hmcCl >>>> >>>> sensor = hmcCl.hmc() >>>> sensor.setConfig() >>>> >>>> count = 0 >>>> while True: >>>> >>>> count += 1 >>>> x = 0 >>>> y = 0 >>>> z = 0 >>>> he = 0 >>>> >>>> os.system("clear") >>>> >>>> x, y, z = sensor.getAvgRead(5) >>>> >>>> print("X: {} Y: {} Z: {} Count: {}".format(x,y,z, count >>>> )) >>>> >>>> print(sensor.getDirection()) >>>> sleep(.2) >>>> >>>> Next is the object file (hmcCl.py): >>>> from Adafruit_I2C import Adafruit_I2C >>>> import math >>>> >>>> class hmc: >>>> >>>> def __init__(self): >>>> self.hmc = Adafruit_I2C(0x1E) >>>> self.debug = False >>>> self.address = 0x1E >>>> >>> >>> >>> busnum? >>> >>> Regards, >>> >>> -- >>> Robert Nelson >>> https://rcn-ee.com/ >>> >>
-- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/56566293-9fed-4c9f-9109-954af352d230%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
