Anfänger sucht Hilfe zu Ansteuerung einer LED mit 2 Tastern

Hallo Zusammen,

habe jetzt die Idee von kulturbereicherer aufgegriffen alles über einen analogen Eingang abzufragen. Klappt soweit, als das ich die Tasten drücke und die LED an geht und wieder aus. Zusätzlich habe ich mir ein LCD integriert, damit ich sehe welchen Taster ich gedrückt habe. Nun möchte ich aber bei Druck des 2. Tasters das die LED an bleibt bis ich den 2. Taster nochmal drücke. Irgendwie hab ich da ein Blockade:-( beim basteln der Schleife, dass das Signal HIGH bleibt. Kann mir bitte jemand helfen?

#include <LiquidCrystal.h>

// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

const int ledPin = 10;
int a=0;
 

void setup() {
  lcd.begin(16, 2);
  pinMode(A5, INPUT_PULLUP);
}

int readButtons(int pin){
  int b,c = 0;
  c=analogRead(pin);  
  if (c>1000)
  {
    b=0; 
  }   
else
  if (c>15 && c<19)
  {
    b=1; 
  }     
  else
    if (c<25 && c>20)
    {
      b=2; 
    }       
return b;
}
 
void loop()
{
  a=readButtons(5);
  lcd.clear();
  if (a==0) // no buttons pressed
  {
    digitalWrite(ledPin,LOW);
    lcd.setCursor(0,1);
    lcd.print("Press a button");
  }   
  else
    if (a==1) 
    {
      digitalWrite(ledPin, HIGH);
      lcd.setCursor(0,2);
      lcd.print("Pressed button ");
      lcd.print(a);
    }
    else
    if (a==2) 
    {  
      digitalWrite(ledPin, HIGH);
      lcd.setCursor(0,2);
      lcd.print("Pressed button ");
      lcd.print(a);
    }
  delay(1000); 
}