2.8 tft lcd problèmes bouton

bonjours a tous. J ai besoin de votre aide
j utilise les bibliothèques -adafruit gfx , MCUFRIEND, TouchScreen.

dans un projet pour activer des électro aimant et lumière ai besoin d utiliser 2 pages avec des bouton différents sur les 2.sauf que j ai les bouton de la page 1 qui sont rémanent sur la page 2.comment faire sans réinitialiser l écran

#include <Adafruit_GFX.h>
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;
#include <TouchScreen.h>
#define MINPRESSURE 200
#define MAXPRESSURE 1000

const int XP = 8, XM = A2, YP = A3, YM = 9; //ID=0x9341
const int TS_LEFT = 890, TS_RT = 155, TS_TOP = 98, TS_BOT = 880;
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300);
Adafruit_GFX_Button on_btn,  off_btn,    bn_btn,  cli_btn,    suiv_btn;
////////////////////////////////////////////////////////////////
int pixel_x, pixel_y;     //Touch_getXY() updates global vars
bool Touch_getXY(void)
{
  TSPoint p = ts.getPoint();
  pinMode(YP, OUTPUT);      //restore shared pins
  pinMode(XM, OUTPUT);
  digitalWrite(YP, HIGH);   //because TFT control pins
  digitalWrite(XM, HIGH);
  bool pressed = (p.z > MINPRESSURE && p.z < MAXPRESSURE);
  if (pressed) {
    pixel_x = map(p.x, TS_LEFT, TS_RT, 0, tft.width()); //.kbv makes sense to me
    pixel_y = map(p.y, TS_TOP, TS_BOT, 0, tft.height());
  }
  return pressed;
}
////////////////////////////////////////////////////////////////
#define BLACK 0x0000
#define NAVY 0x000F
#define DARKGREEN 0x03E0
#define DARKCYAN 0x03EF
#define MAROON 0x7800
#define PURPLE 0x780F
#define OLIVE 0x7BE0
#define LIGHTGREY 0xC618
#define DARKGREY 0x7BEF
#define BLUE 0x001F
#define GREEN 0x07E0
#define CYAN 0x07FF
#define RED 0xF800
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
#define ORANGE 0xFD20
#define GREENYELLOW 0xAFE5
#define PINK 0xF81F
////////////////////////////////////////////////////////////////LED 2 ON OFF                      // LED2ON();LED2OFF(); LED1OFF(); LED1ON();CliOFF(); CliON();
unsigned long LED2ON() {
off_btn.initButton(&tft, 115, 110, 65, 30, WHITE, RED, BLACK, "Led 2", 2), tft.fillRoundRect(95, 30, 50, 50, 10, RED);
  
}
unsigned long LED2OFF() {
  off_btn.initButton(&tft, 115, 110, 65, 30, WHITE, GREEN, BLACK, "Led 2", 2), tft.fillRoundRect(95, 30, 50, 50, 10, GREEN);
}
////////////////////////////////////////////////////////////////LED 1 ON OFF
unsigned long LED1ON() {
 on_btn.initButton(&tft,  40, 110,  65, 30, WHITE, RED, BLACK, "Led 1", 2), tft.fillRoundRect(10, 30, 50, 50, 10, RED);
}

unsigned long LED1OFF() {
 on_btn.initButton(&tft, 40, 110,  65, 30, WHITE, GREEN, BLACK, "Led 1", 2), tft.fillRoundRect(10, 30, 50, 50, 10, GREEN);
}
////////////////////////////////////////////////////////////////LED CLIG////////////////////////////////////////////////////////////////
unsigned long CliOFF() {
  bn_btn.initButton(&tft,  40, 150,  65, 30, WHITE, GREEN, BLACK, "Cli", 2);
}
unsigned long CliON() {
  bn_btn.initButton(&tft,  40, 150, 65, 30, WHITE, RED, BLACK, "Cli", 2);
}
unsigned long CliGNOTEOFF() {
  cli_btn.initButton(&tft,  115, 150, 65, 30, WHITE, GREEN, BLACK, "Cli", 2);
 
}

 suiv_btn.initButton(&tft,  200, 200, 65, 30, WHITE, GREEN, BLACK, "==>", 2);


////////////////////////////////////////////////////////////////ECRAN              // LED2ON();LED2OFF(); LED1OFF(); LED1ON();CliOFF(); CliON();
unsigned long ecran() {
  tft.fillScreen(BLACK);
  tft.setCursor(1, 2);
  tft.setTextSize(2);
  tft.println("LED 1 ");
  tft.setCursor(85, 2);
  tft.setTextSize(2);
  tft.println("LED 2 ");
  if (ledState2 == HIGH)// si btn low carre led1 ver
                         LED2ON();
  if (ledState2 == LOW)// si btn low carre led1 ver
                          LED2OFF(); //off_btn.initButton(&tft, 115, 110, 65, 30, WHITE, GREEN, BLACK, "Led 2", 2), tft.fillRoundRect(95, 30, 50, 50, 10, GREEN);
  if (ledState == LOW)// si btn low carre led1 ver
                          LED1OFF();
  if (ledState == HIGH)// si btn high carre led1 rouge
                         LED1ON();
        CliOFF();
        CliGNOTEOFF();
  on_btn.drawButton(false);
  off_btn.drawButton(false);
  bn_btn.drawButton(false);
   cli_btn.drawButton(false);
}
////////////////////////////////////////////////////////////////ECRAN 2
unsigned long ecran2() {
  tft.fillScreen(BLACK);
  tft.setCursor(1, 2);
  tft.setTextSize(2);
  tft.println("LED 1 ");
  tft.setCursor(85, 2);
  tft.setTextSize(2);
  tft.println("LED 2 ");
  if (ledState2 == HIGH)// si btn low carre led1 ver
             LED2ON();
  if (ledState2 == LOW)// si btn low carre led1 ver
                      LED2OFF();
  if (ledState == LOW)// si btn low carre led1 ver
                LED1OFF();
  if (ledState == HIGH)// si btn high carre led1 rouge
               LED1ON();
               CliOFF();
               CliGNOTEOFF();
  on_btn.drawButton(false);
  off_btn.drawButton(false);
  bn_btn.drawButton(false);
   cli_btn.drawButton(false);
}
////////////////////////////////////////////////////////////////ECRAN3                             // LED2ON();LED2OFF(); LED1OFF(); LED1ON();CliOFF(); CliON();
unsigned long ecran3() {
  tft.fillScreen(BLACK);
  if (ledState2 == HIGH)// si btn low carre led1 ver
                    LED2ON();
  if (ledState2 == LOW)// si btn low carre led1 ver
                         LED2OFF();
  if (ledState == LOW)// si btn low carre led1 ver
                            LED1OFF();
  if (ledState == HIGH)// si btn high carre led1 rouge
                            LED1ON();
                CliON();
                CliGNOTEOFF();
  on_btn.drawButton(false);
  off_btn.drawButton(false);
  bn_btn.drawButton(false);
   cli_btn.drawButton(false);
}
////////////////////////////////////////////////////////////////CLIGNOTE////////////////////////////////////////////////////////////////
unsigned long clignote() {
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;
    if (ledState3 == LOW)
      ledState3 = HIGH;
    else
      ledState3 = LOW;
    digitalWrite(ledPin3, ledState3);
  }
}

void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);

  Serial.begin(9600);
  uint16_t ID = tft.readID();
  Serial.print("TFT ID = 0x");
  Serial.println(ID, HEX);
  Serial.println("Calibrate for your Touch Panel");
  if (ID == 0xD3D3) ID = 0x9486; // write-only shield
  tft.begin(ID);
  tft.setRotation(0);            //PORTRAIT
  tft.fillScreen(BLACK);
  tft.fillScreen(BLACK);
  tft.setCursor(1, 2);
  tft.setTextSize(2);
  tft.println("LED 1 ");
  tft.setCursor(85, 2);
  tft.setTextSize(2);
  tft.println("LED 2 ");
 // LED2ON();LED2OFF(); LED1OFF(); LED1ON();CliOFF(); CliON();
  LED1OFF();
LED2OFF();
 CliOFF();
CliGNOTEOFF();
  on_btn.drawButton(false);
  off_btn.drawButton(false);
  bn_btn.drawButton(false);
   cli_btn.drawButton(false);
  tft.fillRoundRect(10, 30, 50, 50, 10, GREEN);
  tft.fillRoundRect(85, 30, 50, 50, 10, GREEN);



}






void loop() {
  // put your main code here, to run repeatedly:

  bool down = Touch_getXY();
  on_btn.press(down && on_btn.contains(pixel_x, pixel_y));
  off_btn.press(down && off_btn.contains(pixel_x, pixel_y));
  bn_btn.press(down && bn_btn.contains(pixel_x, pixel_y));
   cli_btn.press(down &&  cli_btn.contains(pixel_x, pixel_y));
  if (on_btn.justReleased())
    on_btn.drawButton();
  if (off_btn.justReleased())
    off_btn.drawButton();
  if (bn_btn.justReleased())
    bn_btn.drawButton();
    if (cli_btn.justReleased())
    cli_btn.drawButton();
////////////////////////
  if (on_btn.justPressed()) {
    on_btn.drawButton(true);

    if (ledState == ledPrece) {
      ledState = ! ledPrece;
      digitalWrite(ledPin, ledState);
    }
     ledPrece = ledState;
    ecran2();
     NBRE = 0;
  }
////////////////////////


  if (off_btn.justPressed()) {
    off_btn.drawButton(true);
    if (ledState2 == ledPrece2) {
      ledState2 = ! ledPrece2;
      digitalWrite(ledPin2, ledState2);
    }
    ledPrece2 = ledState2;
    ecran();
     NBRE = 0;
  }
////////////////////////
 if(bn_btn.justPressed()) {//  if  (bn_btn.justReleased()){  if(bn_btn.justPressed()) {
    bn_btn.drawButton(true);
    NBRE = 2;
   
    ecran3();
  }
   if (cli_btn.justPressed()) {
    cli_btn.drawButton(true);
    NBRE = 0;
    digitalWrite(ledPin3,LOW);
     ecran3();
 }
////////////////////////

  if (NBRE == 2) {
    clignote()  ;
 }




}

merci d avance

Je pense qu'il faut ajouter des accolades ici :

if (ledState == HIGH)// si btn high carre led1 rouge
{
               LED1ON();
               CliOFF();
               CliGNOTEOFF();
 }

Et probablement aussi dans écran3