sipeed / MaixPy-v1_scripts

micropython scripts for MaixPy
https://maixpy.sipeed.com
MIT License
625 stars 432 forks source link

Incorrect values for Amigo, plus further error #79

Open AngainorDev opened 3 years ago

AngainorDev commented 3 years ago

No LVGL touchscreen demo does work with MaixPy Amigo.

For once, the i2c pins are not right https://github.com/sipeed/MaixPy_scripts/blob/6ac4f4e97d596d2132b0be0b1fc6bf4139b2fda7/application/lvgl/lvgl_button.py#L11

These should be 24 and 27 for Amigo. Then, there is a further error "OSError: [Errno 5] EIO" when calling ts.init(i2c).

(tried with several firmwares: factory, 0.5.0, 0.5.1, including a custom built one from current master)

In current state, touch panel is not usable with LVGL.

Can you point us to a fix?

AngainorDev commented 3 years ago

Got it finally working by coding a pure python input callback for lvgl, using sample code from MaixUI. Not perfect, but allows to get touch screen semi working with LVGL at least. Will post it later on.

A better option would be to include the full C driver of FT6x36. It's been done for ESP32, could be added as a module to the MaixPy firmware build, see https://github.com/lvgl/lv_port_esp32/pull/48/files

Didn't do it because of the custom build system of MaixPy, didn't know where to put and activate micropython usermods, should be a simple drop and compile op.