Display "Low,Meduim,High" in LCD by potentiometer

  if ((0 <= pot) && (pot >= 85))

Expressing comparisons like this always gives me a headache trying to work out the logic. Try the much simpler form

  if (pot < 85)
{
  //code for low
}
else if (pot >= 86 && pot <= 170)
{
  //code for medium
}
else
{
  //code for high
}
1 Like