Colour and Touch Screen issues with LilyGo AMOLED T-Display

Hi, I have just bought the LilyGo AMOLED touch screen with ESP32-S3 and soldered headers. Great bit of tech, however I’m having some issues with the colours.

I’ve got a sketch from Volos Projects on YouTube with some UI files from Square Line Studio to display buttons/widgets on the screen. When uploading the sketch it tells me I must change “#define LV_COLOR_16_SWAP 1” to “#define LV_COLOR_16_SWAP 0” to match the Squareline Studio settings.

I’ve found this setting in the “lv_conf.h” file and changed the 1 to a 0 and saved and reuploaded.

This time it put the widgets on the screen, but there are 2 problems:

The colours are wrong, what should be blue is yellow, the background is also pink instead of black. I think maybe the colours are inverted in places and just plain wrong in others.

I’m assuming this is to do with changing the LV Color Swap value to 0 as the colours were correct in previous sketches I’ve tried with the value set to 1.
I can confirm the colours are correct when I’ve run other example/test sketches before this, the problem is only happening when using the exported UI files from Squareline Studio.

  1. The touch screen does not respond when trying to use the widgets (Slider, Button, Arc). I’ve tried taking the protective film off but no diffrence either way.

Is there a setting or something that I need to change in a header file somewhere that will activate the touch screen?

Cheers

ok i was using “16 bit” for colour rather than “16 bit swap” in Sqareline.
Changing this fixed the issue.

Still working on getting the touch screen to respond though. Could that be a setting I need to change in Squareline too?

Nice to see the SquareLine Studio setting solved your problem regarding colors.
For the touch, no, SquareLine Studio has no settings for that, the touch-screen driver is initialized and configured in the exported code’s HAL init. It is not known from your post which IDE and board-template you use and which exact model do you have, probably this one: T-Display S3 AMOLED – LILYGO® and it has a github repository, but I think it covers several models, not a single one. Anyway, it might be of help if you haven’t stumbled upon it yet, at least to determine which driver should be included or enabled for the touchscreen: GitHub - Xinyuan-LilyGO/LilyGo-AMOLED-Series: LilyGo AMOLED Series

thank you for this.
I’m using Arduino IDE 2.3.3. - The screen/board is Lilygo ESP32 S3 AMOLED T-Display.

How would I find the HAL init? I’ve looked in the folder where I exported the Squareline files but nothing obvious there.

In the “src” folder of the Lilygo directory, there’s an “lv_conf.h” file that contains a section named HAL Settings but nothing obviously related to touch functions in there either.

It depends on a board-template whether it has an explicit HAL-init function or it does it directly in the main function. Arduino-TFT_eSPI board-template fits in the latter category so the HAL is gradually initialized (first with drivers, then binding them to LVGL input/output) in the beginning of the ‘setup’ function before calling ui_init(). In case of TFT_eSPI the tft.begin() function initializes touch too if the built-in XPT2046 driver is used.