7 inch display esp32 with i2c port & Arduino IDE

I am new to this board, but no matter what I try I cannot get the simplest of devices to work with the I2C port. I know that on an arduino board I use A4 & A5 and have no issues with these devices.
My problems start when using the ESP32 with the 7 inch V2.2 display and as I have said I cannot get the simplest of things to work using the I2c port.

Any advice would be very helpful.

I am trying to use the I2C port with an BME280 board, I have tried various BME libraries to try and utilise the ESP32 I2c Ports and not the Arduino ports.
Please can somebody point me in the right direction. I only at this point want to print the out reading to the serial port.



  • Hello @davidwoolterton ,
    The 5-inch and 7-inch boards only have one set of IICs, with pins 19 and 20. Therefore, when using other IIC devices, you need to share the same set of IICs with the touch function. Moreover, because the touch function will initialize the IIC at the beginning of the program, when you use other IIC devices, you do not need to use the begin function to initialize, otherwise the touch function will be invalid. When you want to communicate with other IIC devices, you need to follow this step: use the begintransmission function to specify the communication address, the write function and the read function to read and write, and finally use endtransmission to end the communication. The communication time should be avoided to be too long, otherwise it will affect the touch function.

    Please refer to this example: https://youtu.be/Hs3UPth3JhM?list=PLwh4PlcPx2Ge-h-Pfsa7juFeWMgXmv8lc

  • My issues have now been resolved.
    Thank you for the advice and I had already watched that example video, and it was not a lot of help in actually reading the BME280 I2C sensor. However I knew it was down to the SDA & SCL pins on the chipset and the libraries. I have now found one which is a modified Adafruit one which now works fine for me. https://github.com/Takatsuki0204/BME280-I2C-ESP32, but I had to also remove my original adafruit280 library.

  • To be honest I thourght this had been resolved, if I do not use the SquarieLine Studio UI then I can get both the BME280 and the DS3231 RTC to work on the ESP32, but when I am trying to integrate a UI then I cannot read the sensors. This has to be down to the sensor libraries. Can anyone recomend ones to use for these two sensors both on the I2C bus.

  • Please do not use the begin function, only use the functions in the red box. It should be noted that it cannot be kept in the loop function for continuous reading, and point gaps should be separated to ensure that the touch function can also be used normally in IIC

  • I have finaly worked out what the problem is but don't know the answer. There is another thread which is my problem to which I have added to.

  • I have now resolved all my issues which have been communicated in the post referred to in the above post.

Sign In or Register to comment.