Use a LCD with a potentiometer

Hello everyone,
I'm actually programming for a project in wich i need to use a 16*2 LCD display with a potentiometer. The LCD has to show different message in fonction of the tension of the potentiometer. I start with this programm but i'm really bad at that, if you can help me.

//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// on définit la constante en donnant un nom et un nombre.

int Pot; //déclaration de la variable qui va stocker la valeur numérique de la tension du potentiomètre

void setup()
{
Serial.begin(9600); //Initialisation de la communication avec la console
}
void loop()
{
Pot=analogRead(A0); //On stocke la valeur lue par le CAN A0 dans la variable valeurPot
Serial.print("Valeur lue : ");Serial.println(Pot);
if (Pot>769)&&(Pot<1023)
{
Serial.println("Ensoleillé");
}
else if (Pot>513)&&(Pot<769)
{
Serial.println("Couvert");
}
else if (Pot>254)&&(Pot<512)
{
Serial.println("Nuageux");
}
else
{
Serial.println("Pluie");

}
}

ProgrammeLCD_Potentiometre.ino (731 Bytes)

Not sure what to help you with. What kind of problem are you having?

One problem I do see is if Pot = 769 you will fall through to the else block.

Read "How To Use This Forum"

in particular, 7. If you are posting code or error messages, use "code" tags

This is what happens when you do not

What problem are you having?
You can learn how to use LCD 16x2 and Potentiometer , and then combine them into one

I just need help for the proramm, i start with something but it seems to don't work.. Because i'm bad at programming, in fact, the programm nned to show different message in fonction of the values of the potentiometer

Change

"else if (Pot>513)&&(Pot<769)"

into

"else if (Pot>513 && Pot<769)"

and the other if's also.