import machine
from imu import MPU6050
from time import sleep
i2c = machine.I2C(0, sda=machine.Pin(0), scl=machine.Pin(1))
imu = MPU6050(i2c,1)
tem=imu.temperature
print('Temperature :', tem)
sleep(0.10)
print('Scanning i2c bus ...')
devices = i2c.scan()
sleep(0.1)
if len(devices) == 0:
print("No i2c device !")
else:
print('i2c devices found:',len(devices))
for device in devices:
print("Decimal address: ",device," | Hexa address: ",hex(device))
sleep(0.1)