WiFi causing problems with Adafruit 2.4" TFT Featherwing

Hello,

I have a problem with usage of TFT display when I connect to WiFi on a HUZZAH32 FeatherWing ESP32 micro-controller. The problem is that as long as I don't connect to WiFi, whole algorithm that tracks pressing of display and displaying numbers/words accordingly works fine. Void setup, loop and local functions, even communication with LabVIEW works completely fine, all variables read are properly saved and displayed and seem to be working just as planned until module finally connects to wireless.

When it does, one thing happens always and that is that somewhere on screen (that isn't black) there is square that flickers very fast (I assume with speed of program running through loop) and the rest is fine. This square isn't in the same place, depending on which local function is running.

Then there is the worse part. Usually, when I'm pressing on display, everything works OK and momentarily that flickering square disappears only to reappear while program is waiting for pressure on display. But sometimes (or basically once it happens it's happening most of the time) the whole display is messed up. Sometimes random colors appear, sometimes the whole screen goes white and sometimes it grays out with darker grey stripes across it that gradually disappear. The pressure to which it is exposed doesn't seem to matter. If it only changes colors, reset button of display board actually resets it, while when it goes white or gray, I most of the time have to re-plug power source to fix it. I tried different micro-controllers and different displays (all the same type), different cables, different placement of connecting to WiFi function and all lead to same result.

Code and pictures in the attachments.

Aplikacija.ino (11.1 KB)