LCD Shield works, sort of...

OK Gang, I have spent many hours and followed the posts of many users trying to work this out. I am using a LCD Keypad shield mounted to a UNO with IDE 1.6.5 to monitor and display temp and humidity using a DHT11 on pin 2 of the UNO. I have everything displaying in the manner I desire except for the actual numbers. IE:
line 1 shows "Temp = NAN' C" (I am using the ' as a degree indicator here)
and line 2 shows "Hum = NAN %" (I believe NAN = not a number)
I am fairly certain that the rats involved are...
float temperature, humidity; (I don't think any of the 'duinos like Floats)
and dtostrf(temperature, 4, 1, tempF);
dtostrf(humidity, 4, 1, humF); (I am understanding, possibly incorrectly, these are used to convert the Floats to usable data)

I am including my current code. ANY ideas or suggestions would be greatly appreciated.

latest lcd - 082315.txt (841 Bytes)

ac1ac:
float temperature, humidity; (I don't think any of the 'duinos like Floats)

That's funny. I use floats all the time and have never had a problem.

I have no idea why you would ever bother to use dtostrf with LCDs

"NAN" is indeed "Not a number". It means you have somehow written some variable to a float which is not in the floating point format rather than formally converting it. As Nick_Pyner says, it is very unlikely that there would be a reason to use floats to process sensor data.

Have you read the warning about that shield at the top of this forum page?

Paul__B, I did read the warning, but according to the listed test procedures, my display should be OK.
Thanks for pointing it out. I am about ready however, to walk away from this one and try using a 1602A display. Essentially the same, but no shield. I am assuming you also went over my current code. Is there any suggestion you might make to get this code to display numbers? I was hoping to get this working by Friday so that I might be able to display current conditions during the "Hood to Coast Relay" this coming weekend. I volunteer as a communications worker as I am also a ham radio operator. I am often asked at this event if I know the current temp, but I have never been able to provide a positive response. Hense the idea of putting this together.

The problem with your code or wiring is in the reading of the DHT11. It is returning NAN ("not a number") and that is being passed to the lcd through dtostrf. I am surprised that dtostrf will take nan as an input and give it as an output without the compiler complaining, but it does.

As other stated, there is no need for dtostrf. lcd.print can take a float.

lcd.print(float,n)// n=number of places after dp

Go to the example programs which come with the DHT11 library, and see if you can get it reporting a number instead of "not a number".

ac1ac:
I am assuming you also went over my current code.

Oh, I would not assume that if I were you! :grinning: I only picked out the details with which I am moderately familiar, confident that someone else would sort it out for you.

And by the way, attachments on this BBS are presently sociopathic - I can read them on this particular machine, but not on many others. Code should be posted in-line with text using the "code" tags (first ones above the submission window).

ac1ac:
Thanks for pointing it out. I am about ready however, to walk away from this one and try using a 1602A display.

I submit there is no need for that. Your display is already working and changing it will at most give you the same temperature reading problem in different colours. There may be a bad connection, but the use of strings suggests the problem is probably due to junk code, and looking there might increase your chances of success by the weekend. I don't use the DHT11, but plenty of people do and have no trouble with it.