Hi everyone, im having a problem when i tray to display a float on lcd.
Im displaying a float number with 1 decimal.
The problem is that after the decimal it shows 2 weird symbols
like this: 2.5@@ (@ = representing the weird symbols).
void loop(){
// read the value on analog input
value = analogRead(analoginput);
vout= (value * 5.0)/1024.0; //voltage coming out of the voltage divider
vin = vout / (R2/(R1+R2)); //voltage to display
lcd.setCursor(0,0);
lcd.println(vin, 1); //Print float "vin" with 1 decimal
Thanks a lot Korman!!!! the weird symbols are gone
Now im struggling with a decimal staying on the lcd.
When the value is higher than 10.0 the decimal shifts one spot to the right on the lcd, and when it goes lower than 10.0 shifts to the left, but the decimal of the number higher than 10.0 stays in there.
Right now I added an lcd.clear(); but the lcd flickers everytime it clears the lcd.
Instead of testing to see if temperature value is less than 10 and executing lcd.clear(), how about something like the following:
[color=#0000ff]Set cursor to (0,0)
Print five spaces.
Set cursor to (0,0)
Print the temperature value.[/color]
lcd flickers
You could further reduce the flickering effect by saving the temperature reading into a separate variable and only writing to the lcd when the current temperature value is not equal to the old value.