TFT repeating touch inputs without being touched repeatedly

Hi

Iam testing a 2.4 TFT LCD in Arduino Uno and I have just example code below. It should write x,y,z when touched, but the issue is its working on its own like if you would pressing the LCD rrepeatedly and I cant find any solutions why its doing it :(((

#include "SPI.h"
#include "Adafruit_ILI9340.h"
#include "XPT2046_Touchscreen.h"

#define LCD_cs 10
#define LCD_dc 9
#define LCD_rst 8
#define DOTYK_cs  7


Adafruit_ILI9340 displej = Adafruit_ILI9340(LCD_cs, LCD_dc, LCD_rst);
XPT2046_Touchscreen dotyk(DOTYK_cs);

void setup() {
  
  displej.begin();
  dotyk.begin();
  displej.setRotation(0);
  displej.fillScreen(ILI9340_BLACK);
  displej.setCursor(0, 0);
  displej.setTextColor(ILI9340_WHITE);
  
  displej.setTextSize(1);
  displej.println("Touch display");
  displej.setTextSize(3);
  displej.println("2.4 TFT LCD");

}

void loop() {

  if (dotyk.touched()) {

    TS_Point bod = dotyk.getPoint();

    displej.fillRect(115, 100, 100, 50, ILI9340_BLACK);
    displej.drawRect(20, 200, 100, 100, ILI9340_RED);
    displej.drawFastHLine(10, 90, 220, ILI9340_BLUE);
    displej.drawFastVLine(110, 90, 100, ILI9340_GREEN);
    displej.setCursor(0, 100);
    displej.setTextColor(ILI9340_WHITE);
    displej.setTextSize(2);

    displej.print("   Tlak = ");
    displej.print(bod.z);
    displej.println(",");
    displej.print("Sour. x = ");
    displej.print(bod.x);
    displej.println(",");
    displej.print("Sour. y = ");
    displej.print(bod.y);
    displej.println();

    if (bod.x > 580 & bod.x < 1660 & bod.y > 2100 & bod.y < 3500 ) {
      displej.setCursor(35, 240);
      displej.print("Stisk!");
    } else {
      displej.fillRect(35, 210, 80, 80, ILI9340_BLACK);
    }
  }
  delay(1);

}

first of all you program has no de-bounce, but probably that does not really matter since most touchscreens return a z value regardless if they are touched or not, (so "touched()" is always true..) suggestion is to read the 'z' value and if it is between certain values then you can consider it 'touched' and execute the whole printing stuff . to determine what the 'z' value delimiters should be write a small program that just print that.

Thanks, but something is weird even with the Z value because if I print the displej.print(bod.z); the values that came out differs so much and Iam even not touching it at all... I mean i just plug the USB to power the arduino, it starts the uploaded program and and the Z value is like 4089 and hne jump to 1080 then to 346 and back to 4090 ect... its acting like crazy