Problem void

I used a certain void in my void loop but I need to sue other voids and it keeps using the first one. So, it’s for a touch shield and the first screen is working with three buttons but when we click on one, it keeps the localization of the three of the first screen (but on another screen).

Here’s the void loop :

void loop ()
{

chosen_btn_scrn1();

Point p = ts.getPoint();
p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240);
p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320);

if (chosen_button_screen1 == 50)
{
Tft.fillScreen(0, 419, 0, 419, WHITE); //white screen
draw_scrn2();
chosen_button_screen1 = 0;

butn_return ();

if (btn_return == -1)
{
Tft.fillScreen(0, 419, 0, 419, WHITE); //écran blanc
draw_scrn1();
btn_return = 0;
}
}

if (chosen_button_screen1 == 51)
{
Tft.fillScreen(0, 419, 0, 419, WHITE); //white screen
draw_scrn5();
chosen_button_screen1 = 0;
butn_return ();
}

if (chosen_button_screen1 == 52)
{
Tft.fillScreen(0, 419, 0, 419, WHITE); //white screen
draw_scrn6();
touche_choisie_screen1 = 0;
butn_return ();
}

And here’s the void chosen_btn_scrn1() :

void chosen_btn_scrn1()
{
Point p = ts.getPoint();
p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240);
p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320);

if ((p.z > __PRESURE) && (9 < p.x) && (p.x < 231) && (80 < p.y) && (p.y < 140)) // btn 1 pressed
{
chosen_btn_screen1 = 50;
}
if ((p.z > __PRESURE) && (9 < p.x) && (p.x < 231) && (190 < p.y) && (p.y < 250)) // btn 2 pressed
{
chosen_btn_screen1 = 51;
}

if ((p.z > __PRESURE) && (60 < p.x) && (p.x < 171) && (268 < p.y) && (p.y < 308)) // btn 3 pressed
{
chosen_btn_screen1 = 52;
}
}

Thanks for your help!

There is no such thing as "a void". They are functions. void is a keyword that indicates, depending on context, there are no arguments to a function, or a function returns nothing, or a reference to an object with no defined type. You have no "voids" in your program. You have void functions, which are functions with no return value.

Regards, Ray L.

Sorry I understand. I'm new on Arduino.

butn_return ();
   
   if (btn_return == -1)

Using meaningful names for functions is far better than just banging on a sequence of keys. A good name contains a noun and a verb, and describes exactly what the function does. butn_return() does not describe what the function does.

Using names for variables that are nearly the same as the names of functions is a bad idea.

but when we click on one, it keeps the localization of the three of the first screen (but on another screen).

Sorry. This makes no sense. Try again, with pictures if needed, and some actual serial output. And ALL of your code.