Hi, I recently got a Beagleboneblue and tested the encoders using the $sudo rc_test_encoders. After flashing my sd card with a new OS everything was working fine. I wanted to test out the i2c capabilities with python. I have heard before that Bealgeboneblue was based heavily off the Bealgeboneblack so I installed adafruit blinka for BBBlack. I then hooked up an i2c device and ran $i2cdetect -y -r 1 and my i2c device was found. I thought it would work because of this. I developed some code to try to practice using i2c and ran it and now I get a bus error when trying to use the test encoders command. Did I accidently write into an address I shouldn’t be writing into?
#/usr/bin/env python3
import time
import busio
from adafruit_blinka.board.beagleboard.beaglebone_black import *
print("Hello Blinka!")
i2c = busio.I2C(pin.I2C1_SCL,pin.I2C1_SDA)
#setup
#wake up sensor
i2c.writeto(0x68, bytes([0x6B]),stop = True)
i2c.writeto(0x6B, bytes([0x00]), stop = True)
#gyro config
i2c.writeto(0x68, bytes([0x00]),stop = False)
i2c.writeto(0x1B, bytes([0x00]), stop = True)
#accel config
i2c.writeto(0x68, bytes([0x00]),stop = False)
i2c.writeto(0x1C, bytes([0x00]), stop = True)
def accel():
i2c.writeto(0x3B, bytes([0x00]),stop = False)
result = bytearray(6)
i2c.readfrom_into(0x68, result)
return result
while True:
ax = accel()
print("x =", ax)
time.sleep(0.005)
I thought this Bus Error would go away after reflashing my sd card. It persisted so I think its a hardware problem? I’m not too sure.
TLDR, used adafruits bealgeboneblack gpio/i2c library on the bealgeboneblue and now I have a bus error when trying to use the encoders. is there anyway to reverse this, is my beagle doomed! or Is the problem caused by something else potentially?
Thanks,
: D