Having trouble with non-changing LCD

So I have been working on a project that has water sensors that connect to Arduino and runs a display command to an LCD with different settings. I was wondering if there is any problem in my code for it to not change from the original set lcd.print(); command outside the loop to the settings inside the loop. There is an extra “}” below the picture. I have also tried using an lcd.clear() function and a setcurser function. They both don’t seem to change the LCD. I do have more coded into this program for other functions such as a switch command for an IR remote but there are no while loops in my code to get stuck. the serial moniter shos that my values are working but the LCD doesn’t change bases on “value1” and “value2”. any help would be great. I also know for a fact that my LCD is plugged in correctly because I have had the LCD work before I changed my code. I don’t know hat I added that made it suddenly not work.

ignore the picture.

#include <LiquidCrystal.h>

#include <boarddefs.h>
#include <IRremote.h>
#include <IRremoteInt.h>
#include <ir_Lego_PF_BitStreamEncoder.h>

const int RECV_PIN = 6;
IRrecv irrecv(RECV_PIN);
decode_results results;
const int WaterSensor1 = A0;
const int WaterSensor2 = A1;
int LimitValveO1 = 9;
int LimitValveO2 = A3;
int LimitValveC1 = 8;
int LimitValveC2 = A5;
int value1;
int value2;
int value3;
int var1 = 0;
int var2 = 0;
int var3 = 0;
int var4 = 0;
int go = 0;
const int rs = A2, en = A3, d4 = A5, d5 = A4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
int OpenPushButton = 7;
int ClosePushButton = 1;
int flag1;
int flag2;
int OpenWValve1 = 10;
int CloseWValve1 = 11;
int OpenWValve2 = 12;
int CloseWValve2 = 13;
//int IRO = 16720605
//int IRC = 16761405
//int PP = 16712445

void setup() {
  irrecv.enableIRIn(); // enable receiver module
  lcd.begin(16, 2);               //set up lcd colums and rows:
  lcd.print("why"); //print a message to the lcd
  pinMode(OpenPushButton, INPUT);
  pinMode(ClosePushButton, INPUT);
  pinMode(LimitValveO1, INPUT);
  pinMode(LimitValveC1, INPUT);
  pinMode(LimitValveO2, INPUT);
  pinMode(LimitValveC2, INPUT);
  pinMode(OpenWValve1, OUTPUT);
  pinMode(OpenWValve2, OUTPUT);
  pinMode(CloseWValve1, OUTPUT);
  pinMode(CloseWValve2, OUTPUT);
  pinMode(WaterSensor1, INPUT);
  pinMode(WaterSensor2, INPUT); 


void loop() {
  value1 = analogRead(WaterSensor1);    // read water sensor  
  value2 = analogRead(WaterSensor2);
  //  Serial.println(digitalRead(LimitValveO1));
  // Serial.println(flag1);


  if (value1 >= 10 & value2 >= 10) {
    lcd.write("1 Wet 2 Wet");       // both wet

  if (value1 >= 10 & value2 <= 10) { //1 wet 2 dry

    lcd.write("1 Wet 2 Dry");
    if(value1<=10 & value2>=10){      //1 dry 2 we//t

     lcd.write("1 Dry 2 Wet");
   if (value1<=10 & value2<=10){        //both dry

     lcd.write("1 Dry 2 Dry");

  //remote variables

  if (irrecv.decode(&results)) {


    switch (results.value) {
      case 16720605:
        var1 = 1;  //open
        var2 = 0;
      case 16761405:
        var2 = 1;   //close
        var1 = 0;
      case 16712445:
        go = 1;
      case 16753245:
        var1 = 0;
        var2 = 0;
        go = 0;

//valve control

  if (var1 == 1) {
    if (digitalRead(LimitValveO1 != 1)) {
      digitalWrite(OpenWValve1, HIGH);
    if (digitalRead(LimitValveO2 != 1)) {
      digitalWrite(OpenWValve2, HIGH);

    else if (digitalRead(LimitValveO1 == 1)) {
      digitalWrite(OpenWValve1, LOW);
    else if (digitalRead(LimitValveO2 == 1)) {
      digitalWrite(OpenWValve2, LOW);


  if (var2 == 1) {
    if (digitalRead(LimitValveC1 != 1)) {
      digitalWrite(CloseWValve1, HIGH);
    if (digitalRead(LimitValveC2 != 1)) { 
      digitalWrite(CloseWValve2, HIGH);

    else if (digitalRead(LimitValveC1 == 1)) { 
      digitalWrite(CloseWValve1, LOW);
    else if (digitalRead(LimitValveC2 == 1)) {
      digitalWrite(CloseWValve2, LOW);


i do have extra integers from changing the code a lot but ignore them if they are not used

Posting a picture of code is not the way to post code if you really want help. Read the how to use this forum-please read sticky to see how to properly post code and some advice on how to ask an effective question. Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code.

There is a difference between bitwise and (&) and logical and (&&). You might want to see if one or the other is best for your if statements.

sorry about that, i fixed it. And I am a beginner so I do not yet know the difference between & and && in code but i will research that right now to see if it will help. I have used these commands before though and they did work. another thing that might be useful to know to help is that the LCD does display the original display in the setup but doesnt change for the if commands in the loop. and I have checked the serial monitor and the "value1" and "value2" integers do change in the way i want.

I also would like to know if you can display the LCD screen to the serial monitor to check if it is supposed to change but isnt for another reason. like Serial.print("the LCD display") but dont know how/ what to use inside the parentheses.

int LimitValveO2 = A3;
int LimitValveC2 = A5;

const int rs = A2, en = A3, d4 = A5, d5 = A4, d6 = 3, d7 = 2;

Seems that you are using A3 and A5 for 2 different things.

int ClosePushButton = 1;

Is that a pin number? On most Arduino boards, pin 1 is the hardware serial TX. That can cause a conflict.

yes on both, thanks for the reply, I did have it on 1 but im not using that motor right now i was just testing if it would work on port 1. I did change it to a different port. And thank you for catching the double ports, i forgot to change the first two to different ports. that might be this issue.

you are a life saver, it was the simple thing that I couldn't figure out. It does work now and I did have to add an lcd.setCursor(0,0); command in each one. Thank you so much!

You are very welcome.