I tried that out but it just still shows whole numbers instead of 0.5 steps. It is not an lcd issue, since the same values are found in the Serial Monitor.
const byte PotPin = A0;
void setup(){
Â
}
void loop(){
 int val = map(analogRead(PotPin), 0, 1024, 0, 101); //will map nicer to 0-100
Â
 lcd.print(val / 2);
 lcd.print(".");
 lcd.print(val % 2 ? 5 : 0);
}
If you really want to big and slow float way, try dividing by 2.0
voidsetupcolor=#000000[/color] {
 Serial.begincolor=#000000[/color];
 whilecolor=#000000[/color];
 for(inti=0;i<1024;i++){
   floatactual=round(i*100.0/1023.0)/2.0;
   Serial.printcolor=#000000[/color];
   Serial.printcolor=#000000[/color];
   Serial.printcolor=#000000[/color];
   Serial.printcolor=#000000[/color];
   size_tprinted=printInHalfSteps(Serial,i);
   Serial.printcolor=#000000[/color];
   Serial.printlncolor=#000000[/color];
 } }
This sketch prints 0-100%
Trims bad pot extremes, even spacing, pre-read, deadband, etc.
Easy to divide final 'potpercentage' by two.
Leo..
// converts the position of a 10k lin(B) pot to 0-100%
// pot connected to A0, 5volt and ground
int rawValue;
int oldValue;
byte potPercentage;
byte oldPercentage;
void setup() {
 Serial.begin(115200); // set serial monitor to this baud rate, or change the value
}
void loop() {
 // read input twice
 rawValue = analogRead(A0);
 rawValue = analogRead(A0); // double read
 // ignore bad hop-on region of a pot by removing 8 values at both extremes
 rawValue = constrain(rawValue, 8, 1015);
 // add some deadband
 if (rawValue < (oldValue - 4) || rawValue > (oldValue + 4)) {
  oldValue = rawValue;
  // convert to percentage
  potPercentage = map(oldValue, 8, 1008, 0, 100);
  // Only print if %value changes
  if (oldPercentage != potPercentage) {
   Serial.print("Pot percentage is: ");
   Serial.print(potPercentage);
   Serial.println(" %");
   oldPercentage = potPercentage;
  }
 }
}