digitalRead -LCD Screen

I am simply trying to have an LCD print "22 is High" when a button is pressed and "22 is Low" when it is not pressed. However, I only want it to print once so that it doesn't repeat the print and fill up the LCD screen with the message.

Currenty, it seems to only print "22 is High" only sometimes when the button is pressed. Even when it does read "22 is High" it will continue to say this even when the button is released.

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3f, 20, 4);
int clearState;
bool AlreadyWritten = false;
void setup() {
  // put your setup code here, to run once:
pinMode(22,INPUT);
digitalWrite(22,HIGH);
  lcd.begin();

  // Turn on the blacklight and print a message.
  lcd.backlight();
}

void loop() {
  // put your main code here, to run repeatedly:
if (digitalRead(22)== HIGH){
  if (AlreadyWritten == false){
    lcd.clear();
    lcd.setCursor(0,0);
  lcd.print("22 is LOW");
  AlreadyWritten = true;
  }
  if (digitalRead(22) == LOW){
    AlreadyWritten = false;
  }
}
else{
   if (AlreadyWritten == false){
    lcd.clear();
  lcd.setCursor(0,0);
lcd.print("22 is HIGH");
AlreadyWritten = true;
  }
    if (digitalRead(22) == HIGH){
    AlreadyWritten = false;
  }
}
}

You haven't told us what currently happens.

Thanks - Original post edited

  if (digitalRead(22) == HIGH) {
    if (AlreadyWritten == false) {
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("22 is LOW");
      AlreadyWritten = true;
    }
    if (digitalRead(22) == LOW) {

You are testing for a low on pin 22, inside an if statement that is only executed if pin 22 is HIGH.

Ah! I see. I removed the conflicting if statements from the digitalRead 'if' and 'else' statements. Also added another boolean variable. Not sure if I'm doing this the easiest way, but it is working exactly as it should. Thanks for your help!

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3f, 20, 4);
int clearState;
bool HighAlreadyWritten = false;
bool LowAlreadyWritten = false;
void setup() {
  // put your setup code here, to run once:
pinMode(22,INPUT);
digitalWrite(22,HIGH);
  lcd.begin();

  // Turn on the blacklight and print a message.
  lcd.backlight();
}

void loop() {
  // put your main code here, to run repeatedly:
if (digitalRead(22)== HIGH){
  HighAlreadyWritten=false;
  if (LowAlreadyWritten == false){
    lcd.clear();
    lcd.setCursor(0,0);
  lcd.print("22 is LOW");
  LowAlreadyWritten = true;
  }
}
else{
  LowAlreadyWritten=false;
   if (HighAlreadyWritten == false){
    lcd.clear();
  lcd.setCursor(0,0);
lcd.print("22 is HIGH");
HighAlreadyWritten = true;
  }
}
}