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] 
> <javascript:>> 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/9ee8a775-07cf-40e6-893d-57b76c267117%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to