A little help to understand the basics of using I2C with UIFlow
Arno last edited by
I'm looking for examples of using components in I2C to understand how to use them with UIFlow.
For example a PCF8575 or others
I am completely stuck on my project ...
thank you in advance for your help
@arno You need to read and understand the data sheets for the I2C components you want to learn there are quite a few I2C devices in the M5Stack range, these are visable as they have red connectors on one end.
Arno last edited by
Thanks for the reply, but I was waiting for some help ...
I already have several I2C modules from M5Stack, but my project requires other I2C connections with components that are not in the M5Stack catalog.
There is indeed a user who has already connected other I2C modules who could upload a screenshot of UIFlow for examples.
It would be really damaging if the M5Stacks could not be connected to other modules, it would considerably limit their use.
plusulli last edited by
there is a demo in Uiflow " I2C DHT12 " where it is done like this
UIFlow is built on MicroPython.
Micropython needs "Drivers" in order to support devices.
In order to use none M5Stack devices with UIFlow you need to understand the data sheets for the devices and build Micropython "Drivers" that tell MicroPython how to handle the device.
This is not easy if you have never done this before. I have got a partial driver working for a CAP1188 device from adafruit for a client but its miles from usable. There are several members who have developed their own drivers but there is not much documentation on how its done.
I recommend you check out the Micropython forums at MicroPython.org for more help on developing drivers.
From what Little I understand ------
I2C devices connect to Port A, Make sure the SDA and SCL pins of the new device yo want to use are connected to the correct pins on Port A (White&Yellow wires)
Next in UIFlow use:
To scan and list I2C devices connected to the ESP32. This list returns values in decimal and so you need to read the devices data sheet to find the hex address and convert the returned decimal list into hex values.
Next you need to read the data sheet to find out how to initialise the device and then how to read the device.
Once you have a code that returns the data that you need, you need to convert it to a library or driver, download the driver to the esp32 and then create custom blocks in the custom block creator
That will allow you new driver/library to work in uiflow.