External libraries and I2C via UIFLOW



  • It would be really to nice to have a tutorial using I2C blocks of UIFLOW and using external I2C devices. I tried to get readings from Adafruit BNO055 using execute block but just receive errors.
    Did anyone try to connect a non M5STACK I2C sensor via UIFLOW ?



  • I wanted to know the same thing. I just received this one from Seed Studio that I’m trying to get working with uiFlow.

    https://www.seeedstudio.com/Grove-I2C-Mini-Motor-Driver-p-2508.html



  • @hetzer said in External libraries and I2C via UIFLOW:

    It would be really to nice to have a tutorial using I2C blocks of UIFLOW and using external I2C devices. I tried to get readings from Adafruit BNO055 using execute block but just receive errors.
    Did anyone try to connect a non M5STACK I2C sensor via UIFLOW ?

    Yes and I did get some limited success but haven't had the time to continue work on it.
    I2c works a bit funny in the latest versions of uiflow and takes some getting used to.
    It takes a combination of uiflow blocks and micropython hacking to get things to talk.

    @world101 said in External libraries and I2C via UIFLOW:

    I wanted to know the same thing. I just received this one from Seed Studio that I’m trying to get working with uiFlow.

    https://www.seeedstudio.com/Grove-I2C-Mini-Motor-Driver-p-2508.html

    That looks useful


  • M5Stack

    I have also been trying myself many times to interface with an I2C device and was only once successful with a sevseg display from seeed. This was back before we switched back to the main micropython branch and now I2C seems completely broken for anything other than M5Stack devices. If i use commands from the micropython 11.1 documentation I always get bus error, here is the precious little information about I2C commands in the latest UIflow firmware.

    import i2c_bus
    # port i2c_bus.PORTA, i2c_bus.PORTB or (sda, scl)
    i2c1 = i2c_bus.easyI2C(port, addr)
    
    i2c1.write_u8(reg, data)
    # byteorder: 'big' or 'little'
    i2c1.write_u16(reg, data, byteorder='big')
    #
    data = i2c1.read_u8(reg):
    # byteorder: 'big' or 'little'
    data = i2c1.read_u16(reg, byteorder='big')
    # data is bytes
    data = i2c1.read(num)
    # state: True or False
    state = i2c1.available()
    # addrList is a available addr list
    addrList = i2c1.scan()