Need help with lcd and arduino coding, buttons.

This is my code and I get the error about the “pinMode(lcd, OUTPUT);” and I don’t know how to solve it, I am using the LCD keypad shield

I am also just starting to learn

#include <LiquidCrystal.h>

LiquidCrystal lcd(8, 9, 4, 5, 6, 7)

const int buttonPin = 2;
const int ledPin = 13;

int buttonState = 0;

void setup() {
lcd.begin(16, 2)
pinMode(lcd, OUTPUT);
pinMode(buttonPin, INPUT);
}

void loop() {

buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
lcd.print(“Hi”);
} else {
lcd.print(“Bye”);
}
}

pinMode(lcd, OUTPUT);

Did you mean:

pinMode(ledPin, OUTPUT);

?

ok it helped but now it spams me with hi and bye when i press the button

It is doing what the code says to do. What do you want to happen?