Makerfabs / ESP32-S3-Parallel-TFT-with-Touch-7inch

37 stars 12 forks source link

LvglWidgets example code gives error: [Wire.cpp:513] requestFrom(): i2cRead returned Error -1 #1

Closed juswes closed 11 months ago

juswes commented 1 year ago

When trying out the LvglWidgets example code I keep getting the error: [Wire.cpp:513] requestFrom(): i2cRead returned Error -1 via the serial monitor log. And the CPU keeps running at 95%, making the touch display unusable. It think it might have to do with this issue: https://forum.lvgl.io/t/arduino-lvgl-i2c-problem/10551/3

Any idea what is going on / how to fix this?

juswes commented 11 months ago

I found the issue. The "pin_init()" function is not present in the "touch.h" file for this example code. And also, "pin_init();" is never called in "setup()".

That's why touch was not working in this example code and I got the error: [Wire.cpp:513] requestFrom(): i2cRead returned Error -1

When adding the "pin_init()" function in the "touch.h" and calling "pin_init();" in "setup()" the code is working.