import time
sda=machine.Pin(23, 1, machine.Pin.PULL_UP)
scl=machine.Pin(22, 1, machine.Pin.PULL_UP)
i2c=machine.I2C(scl=scl,sda=sda)
i2c.scan()

i2c.writeto_mem(104, 107, b'\x80')


'''
while True:
    xyz=i2c.readfrom_mem(104, 0x41, 2)
    print("%03.3f"% ((xyz[1]+xyz[0]*256)/180))
    time.sleep(0.15)
'''
while True:
    xyz=i2c.readfrom_mem(104, 0x3b, 6)
    print("%f %f %f \n"% ((xyz[1]+xyz[0]*256)/32768, (xyz[3]+xyz[2]*256)/32768, (xyz[5]+xyz[4]*256)/32768))
    time.sleep(0.15)
