LCD is functioning, will not display

Hello, I am currently doing a school project where I need to code 2 LCD screens to read the current score of both players. The LCD should take indirect input from the PIR Motion sensors which make either integer ‘x’ or ‘y’ increment by one. In the end, once one score reaches 10, the LDC should clear and reset.

I can’t fully understand where to put certain parts of code to make them run my desired way.

Heres said code:

#include <LiquidCrystal.h>
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int pin_to_sensor = 9;
const int PIN_TO_SENSOR = 8;   // the pin that OUTPUT pin of sensor is connected to
int pinStateCurrent   = LOW;
int pinStatePrevious = LOW; // previous state of pin
int x = 0;
int y = 0;


void setup() {

  // put your setup code here, to run once:
  pinMode(8, INPUT);
  pinMode(9, INPUT);
  lcd.begin(16,1);
  int x = constrain(x, 0, 10);
  int y = constrain(y, 0, 10);

}

void screen() {
  lcd.print(F("Player 2:"));

  lcd.print(F("Player 1:" ));
}

void score() {
  if  (8, HIGH) {
    ++y ;
    lcd.print( 'y' );
    delay(2000);
  }
  else (9, HIGH); {
    ++x;
    lcd.print( 'x' );
    delay(2000);
  } 
}
void loop() {
  pinStatePrevious = pinStateCurrent;
  pinStateCurrent = digitalRead(8);
  pinStateCurrent = digitalRead(9);
  void score();
  void screen(); 
 lcd.noAutoscroll();
}

ANY and ALL help is appreciated. P.S I only just started learning Arduino about a year ago so please go easy on me.

Please,
Always use code tags (</> ) when posting code or compiler error messages.

RV mineirin

You forgot to tell us how you actually wired the LCD, and to explain the actual problem you are having. Also, please use code tags when posting code. Check the posting guides for instructions.

Start with some clear, very simple example and make sure you get it working, before trying to write your own code.

Don’t forget that many LCD displays have a contrast potentiometer, and it must be set correctly to see the displayed characters.

I am also new to the site, my apologies.

I would just post an attachment but sadly the forum will not let me. If I must be more in-depth the 4 data pins of the LDC are left with nothing in them as they should be; the LCD is on both backlight, and screen; just nothing is printed to it. However, it was printing before just not what I intended so I do not believe the problem lies within the wiring. The potentiometer is also allowing enough voltage so you would easily be able to see what is printed on the screen.

Hi, @sapphires_2003
Welcome to the forum.

To add code please click this link;

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Rather than jump in with displaying many things.
Just try “Hello World”.
The Library you are using should have some examples for you to try.

Thanks… Tom… :grinning: :+1: :coffee: :australia:
PS, Be patient with the forum software, its restricting you actions for a limited time, to make sure you aren’t a robot or spamming.

Go back to what you had “before”, make sure that it still prints, then make changes in the code one at a time. If the LCD stops printing, the last change was incorrect.

This is unusual, but not impossible. It is the configuration for a single line screen:

If you are still having trouble, start by creating a simple sketch to print “hello world” to the LCD.

No way! :rofl: