code compiled but no display on screen

hey guys fairly new to coding and have this code as shown below cant see any errors in it as is and it finishes uploading and compiling without any error messages yet I still don't see anything on the display I have already tried turning the pedometer on the back and it doesn't do anything if anyone could help it would be greatly appreciated thanks!
code is below

//Compatible with the Arduino IDE 1.0

//Library version:1.1

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x3F,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display

// this constant won't change:

const int Up_buttonPin = 2; // the pin that the pushbutton is attached to

const int Down_buttonPin = 3;

// Variables will change:

int buttonPushCounter = 0; // counter for the number of button presses

int up_buttonState = 0; // current state of the up button

int up_lastButtonState = 0; // previous state of the up button

int down_buttonState = 0; // current state of the up button

int down_lastButtonState = 0; // previous state of the up button

bool bPress = false;

void setup()

{

Serial.begin(9600);

pinMode( Up_buttonPin , INPUT_PULLUP);

pinMode( Down_buttonPin , INPUT_PULLUP);

lcd.init(); // initialize the lcd

// Print a message to the LCD.

lcd.backlight();

lcd.setCursor(0,0);

lcd.print("Score:");

lcd.setCursor(2,1);

lcd.print(buttonPushCounter);

}

void loop()

{

checkUp();

checkDown();

if( bPress){

bPress = false;

lcd.setCursor(2,1);

lcd.print(" ");

lcd.setCursor(2,1);

lcd.print(buttonPushCounter);

}

}

void checkUp()

{

up_buttonState = digitalRead(Up_buttonPin);

// compare the buttonState to its previous state

if (up_buttonState != up_lastButtonState) {

// if the state has changed, increment the counter

if (up_buttonState == LOW) {

bPress = true;

// if the current state is HIGH then the button went from off to on:

buttonPushCounter++;

Serial.println("on");

Serial.print("number of button pushes: ");

Serial.println(buttonPushCounter);

} else {

// if the current state is LOW then the button went from on to off:

Serial.println("off");

}

// Delay a little bit to avoid bouncing

delay(50);

}

// save the current state as the last state, for next time through the loop

up_lastButtonState = up_buttonState;

}

void checkDown()

{

down_buttonState = digitalRead(Down_buttonPin);

// compare the buttonState to its previous state

if (down_buttonState != down_lastButtonState) {

// if the state has changed, increment the counter

if (down_buttonState == LOW) {

bPress = true;

// if the current state is HIGH then the button went from off to on:

buttonPushCounter--;

Serial.println("on");

Serial.print("number of button pushes: ");

Serial.println(buttonPushCounter);

} else {

// if the current state is LOW then the button went from on to off:

Serial.println("off");

}

// Delay a little bit to avoid bouncing

delay(50);

}

// save the current state as the last state, for next time through the loop

down_lastButtonState = down_buttonState;

}

First off please read th how to use this forum sticky post to find out how to use code tags, then go back and modify that first post. While you are at it format the code in the IDE, that will get rid of all that white space you have.

When a program compiles and loads it only means the compiler can make sense of the code you wrote. It does not mean the code you wrote will do what you want.

When dealing with hardware there is the added problem that thi has to correct as well before it will work. You haven’t shown a schematic of you Arduino and display so we don’t know if it is wired up correctly. So are you using the right pins A4&5 not D4&5? Have you got a pullup resistor on each line? What value is it?

 LiquidCrystal_I2C lcd(0x3F,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display

It is always worrying when the code says something different to the comment. Here you are setting the address to 0x3f and yet the comment says your setting it to 0x27, what address is it set to
.
Have you run the I2C scan program to see if the Arduino is picking up the device and what address is it at?

hey sorry about that as i said I'm very new to code and am doing this as a school project I have fixed the 0x3 and am going with the 0x27 just missed it as I was finalizing the code the project is at school but I will check the pins when I return next thankyou

You could use your posts here to practise your punctuation and use of capitals.

For an I2C LCD display to work, the I2C address and the I2C backpack to LCD pin mapping must be correct. If the library default settings for either or both are not correct the LCD will not work. You can try to figure out the right pin mapping and use an I2C scanner to find the address, but if you install and use the hd44780 library that is done automatically by the library.

Install the hd44780 library. The hd44780 library is the best available for I2C LCDs. The library is available in the Library Manager. Go to Library Manager (in the IDE menus, Sketch, Include Libraries, Manage Libraries) and in the Topics dropdown choose Display and in the Filter your search box enter hd44780. Select and install the hd44780 library by Bill Perry.

The class that you want to use is the hd44780_I2Cexp class. There are examples to show how to use the library. The nice thing about the hd44780 library is that it will autodetect the I2C address and the I2C backpack to LCD pin mapping.

In the examples, there is a diagnostic sketch that will help us to help you if you still have trouble with the display. Run the diagnostic sketch and post the results.

Read the how to use this forum-please read sticky to see how to properly post code. * Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code.*

Here we are allowed to break up long single paragraphs to help people read the context of a message.
After all it is a Forum not a cell phone or social media or even twitter.

Your report was closed without further actions.

As you are new you may find the following two posts quite helpful.

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.