redefinition of 'LiquidCrystal lcd'

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int button1 = 6;
int button2 = 7;
int button3 = 8;
int led1 = 13;

void setup()
{
  lcd.begin(16, 2);
  lcd.print("Welcome");
  pinMode(button1,INPUT);
  pinMode(button2,INPUT);
  pinMode(button3,INPUT);
  pinMode(led1,OUTPUT);
}

void loop()
{
  if (digitalRead(button1) == HIGH) (
    lcd.print("INVALID CHOICE!");
    delay(5000);
    clear()
  if (digitalRead(button2) == HIGH) (
     lcd.print("INVALID CHOICE!");
    delay(5000);
    clear();
  if (digitalRead(button3) == HIGH) (
    lcd.print("VALID CHOICE!");
   digitalWrite(led1, HIGH);
    delay(5000);
   clear();
   digitalWrite(led1,LOW);
  
}

I checked and I think i set up the LCD properly, but it said no, can anyone point out the error of my ways.

  if (digitalRead(button1) == HIGH) (

Curly braces,not parentheses, for code blocks.

    clear()

Statements end with ;

Which object has a clear() method that you are trying to call?

After fixing these issues, the only "error" I get is:

Binary sketch size: 2,612 bytes (of a 32,256 byte maximum)

Hi,
Check out how to construct IF statements and the use of { } brackets in REFERENCE.

lcd.clear();
I think is what you are trying for.
Any command that is directed to the LCD will have lcd. as its prefix, look up the examples in the IDE.

Also try TOOLS then Auto Format.
It will lay your sketch out so you can see if statements and their fields.

Tom.... :slight_smile: