from machine import SoftI2C, I2C, Pin
from time import sleep_ms

BATTER_ADDR = 9

i2c = I2C(1, scl=Pin(7, pull=Pin.PULL_UP), sda=Pin(6, pull=Pin.PULL_UP))
print("i2c", i2c)

while True:
    print("scan", i2c.scan())
    sleep_ms(500)

sleep_ms(1000)
i2c.writeto(BATTER_ADDR, b'DISPENSE')
while True:
    c = i2c.readfrom(BATTER_ADDR, 1)
    print("got", c)
    sleep_ms(500)
