Hi

I have progammed a code with a touch screen (librarie Adafruit_FT6206.h). This touch screen runs perfect if I use only one form.

If I use a second form, the touch functionality from the first form is also additional used and I have wrong things on the screen....

Is it possible to end the using of the touch screen on the first form and restart it at the next form with the new buttons??

I have entered the code of one form:

Code:

void TouchEingabe()
{
// See if there's any touch data for us
while (TouchEnde == false)
{
if (ts.touched())
{
// Retrieve a point
TS_Point p = ts.getPoint();
// rotate coordinate system
// flip it around to match the screen.
p.x = map(p.x, 320, 0, 0, 320);
p.y = map(p.y, 480, 0, 0, 480);
int y = display.height() - p.x;
int x = p.y;
if((x >= 25) && (x <= 95)) {
if ((y >= 140) && (y <= 210)) {
z = 1;
}}
if((x >= 115) && (x <= 185)) {
if ((y >= 140) && (y <= 210)) {
z = 2;
}}
if((x >= 205) && (x <=275)) {
if ((y >= 140) && (y <= 210)) {
z = 3;
}}
if((x >= 295) && (x <= 365)) {
if ((y >= 140) && (y <= 210)) {
z = 4;
}}
if((x >= 385) && (x <= 455)) {
if ((y >= 140) && (y <= 210)) {
z = 5;
}}
if((x >= 25) && (x <= 95)) {
if ((y >= 230) && (y <= 300)) {
z = 6;
}}
if((x >= 115) && (x <=185)) {
if ((y >= 230) && (y <= 300)) {
z = 7;
}}
if((x >= 205) && (x <= 275)) {
if ((y >= 230) && (y <= 300)) {
z = 8;
}}
if((x >= 295) && (x <= 365)) {
if ((y >= 230) && (y <= 300)) {
z = 9;
}}
if((x >= 385) && (x <= 445)) {
if ((y >= 230) && (y <= 300)) {
z = 0;
}}
if((x >= 25) && (x <=95)) {
if ((y >= 20) && (y <= 90)) {
z = 11;
}}
if((x >= 355) && (x <= 425)) {
if ((y >= 20) && (y <= 90)) {
TouchEnde = true;
z = 12;
}}
delay (200);
if ((z >= 0) && (z <= 9)){
kWert = (kWert * 10) + z;
}
if (z == 11){
kWert = kWert / 10;
}
display.setCursor(160, 35);
if (kWert != kWertAlt) {
display.fillRoundRect(145, 20, 190, 70, 12, ILI9488_WHITE);
display.print(kWert);
kWertAlt = kWert;
}}
}}

Someone an idea how to stop the using of the touch and restart it new in a new form??

Greetings

Gary