import time
import busio
import board
from adafruit_mpu6050 import MPU6050
Utiliza los pines específicos para el bus I2C-4
i2c_bus = busio.I2C(board.D4_B3, board.D4_B2)
Inicializa el sensor MPU6050
mpu = MPU6050(i2c_bus)
while True:
# Lee los datos del acelerómetro
accel_x, accel_y, accel_z = mpu.acceleration
# Lee los datos del giroscopio
gyro_x, gyro_y, gyro_z = mpu.gyro
# Imprime los datos del acelerómetro y giroscopio
print(f"Acelerómetro: X={accel_x:.2f}, Y={accel_y:.2f}, Z={accel_z:.2f} m/s^2")
print(f"Giroscopio: X={gyro_x:.2f}, Y={gyro_y:.2f}, Z={gyro_z:.2f} rad/s")
print("")
# Espera un segundo antes de la siguiente lectura
time.sleep(1)
@Nasca I have some previous HV, and i use bus 3, pin 3, and pin 5 on this board, however, i noticed the new revision: Hardware interface description | Radxa Docs i2c3 is not available, is it correct?
Can you provide which HW version is the latest one and clarify this for the latest board version:
“Pin 3, Pin 5, Pin 27, and Pin 28 add extra pull-up resistors for I2C device power supply, so they work abnormally when used as GPIOs.”
Yep, i disabled it. I thought it fusb was necessary to be enabled for the wifi, but board works without it.
I haven’t tested USB3 yet. Can you clarify what the fusb302 at 3W is for?
I used the i2c = busio.i2c(board.D4_B3, board.D4_B2) with great success. However, I have two screens I want to use that can be identified ad 0x3c and 0x3d when I run i2cdetect -y 4 as a search.
Is there any way I can set the address when coding with busio?
It should not be possible to set an i2c address by encoding it. The I2C address is set by hardware. In i2c Oled, this can be set via the address selection line or via other hardware means.