Making DHT display Fahrenheit temperatures.

I recently made an Arduino thermostat using a DHT11 and a tft screen. I am trying to get it to show a temperature Fahrenheit. I got it to do this but then had an issue with it. It was only showing degrees Fahrenheit that were divisible by 1.8. If anyone knows a solution to this please help.

#define DHTPIN A5
#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

float hum;
float temp;

#include <Adafruit_GFX.h>
#include <MCUFRIEND_kbv.h>
MCUFRIEND_kbv tft;

#define BLACK 0x0000
#define RED 0xF800
#define GREEN 0x07E0
#define WHITE 0x000FFF
#define GREY 0x8410

void setup(void)
{
uint16_t ID = tft.readID();
if (ID == 0xD3D3) ID = 0x9481; //force ID if write-only display
tft.begin(ID);
tft.setRotation(45);
dht.begin();
}
void loop(void)
{
float converted = 0.00;

hum = dht.readHumidity();
temp= dht.readTemperature();

converted = ( temp * 1.8 ) + 32;

tft.fillScreen(BLACK);
tft.fillRect(30, 20, 270, 200, RED);
tft.setTextColor(WHITE);
tft.setTextSize(8);
tft.setCursor(100, 40);
tft.print(converted);
tft.print("F");
tft.setCursor(70, 140);
tft.print(hum);
tft.print("%H");
delay(7000);
}

post some examples

What do you mean by that

The DHT11 sensor has a resolution of 1 degree Celsius, so you are going to gets steps of 1.8 degrees in Fahrenheit. You can keep a running average over several samples to smooth the transitions, but if you want better resolution use a DHT22, which has a resolution of 0.1 degree Celsius.

Ok the temperature does no very often so the average will probably be similar to the data values it reads. I think I am going to use a DHT22 or other sensor. Thank you for the help.

 temp= dht.readTemperature();

Try

 temp= dht.readTemperature(false);

and

 temp= dht.readTemperature(true);

UKHeliBob:

 temp= dht.readTemperature();

Try

 temp= dht.readTemperature(false);

and

 temp= dht.readTemperature(true);

That does the calculation for Celsius to Fahrenheit in the library, but the DHT11 only sends data in Celsius with a resolution of 1 degree so the Fahrenheit temperature will still be in steps of 1.8 degrees.

gcjr:
post some examples

for simulated readTermperature output values 1, 2, 3, 4, ...

 temp   1.00, converted  33.80
 temp   2.00, converted  35.60
 temp   3.00, converted  37.40
 temp   4.00, converted  39.20
 temp   5.00, converted  41.00
 temp   6.00, converted  42.80
 temp   7.00, converted  44.60
 temp   8.00, converted  46.40
 temp   9.00, converted  48.20
 temp  10.00, converted  50.00