Suche eine Code für Temp / Humidity on a TFT LCD

Bin auf der suche nach einem Code für einen Temp / Humidity on a TFT LCD

DHT22
Arduino UNO
LCD Display 1.8tft ST7735R

Es gibt zwar im Internet einen Code aber der funktioniert leider nicht.
Bekomme nur Fehlermeldungen.

/*
Arduino TFT text example

This example demonstrates how to draw text on the
TFT with an Arduino.

This example code is in the public domain

Created 15 April 2013 by Scott Fitzgerald

http://arduino.cc/en/Tutorial/TFTDisplayText

Modded by Steve Spence of http://arduinotronics.blogspot.com


*/

#include "SPI.h"

#include "ST7735.h"


// Pins SCLK and MOSI are fixed in hardware, and pin 10 (or 53)
// must be an output
//#define sclk 13 // for MEGAs use pin 52
//#define mosi 11 // for MEGAs use pin 51
#define cs 10 // for MEGAs you probably want this to be pin 53
#define dc 9
#define rst 8 // you can also connect this to the Arduino reset

// pin definition for the Leonardo
// #define cs 7
// #define dc 0
// #define rst 1

// create an instance of the library
TFT TFTscreen = TFT(cs, dc, rst);

// char array to print to the screen
char tempPrintout[6];
char humPrintout[6];




// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain
// Fahrenheit conversion added by Steve Spence, http://arduinotronics.blogspot.com

#include "DHT.h" //https://learn.adafruit.com/dht/downloads



#define DHTPIN 2 // what pin we're connected to

// Uncomment whatever type you're using!
//#define DHTTYPE DHT11 // DHT 11
#define DHTTYPE DHT22 // DHT 22 (AM2302)
//#define DHTTYPE DHT21 // DHT 21 (AM2301)

// Connect pin + (middle) of the sensor to +5V
// Connect pin S (on the right) of the sensor to whatever your DHTPIN is
// Connect pin - (on the left) of the sensor to GROUND
// Connect 10k resistor between S and +

int cycleTime = 2000;

DHT dht(DHTPIN, DHTTYPE);

float h;
float t;

void setup() {

// Put this line at the beginning of every sketch that uses the GLCD:
TFTscreen.begin();

// clear the screen with a black background
TFTscreen.background(0, 0, 0);

// write the static text to the screen
// set the font color to white
TFTscreen.stroke(255,255,255);
// set the font size
TFTscreen.setTextSize(2);
// write the text to the top left corner of the screen
TFTscreen.text("Temp (F)",0,0);
// write the text to the top left corner of the screen
TFTscreen.text("Humidity (%)",0,60);
// ste the font size very large for the loop
TFTscreen.setTextSize(4);

dht.begin();

}

void loop() {

// Read the value of the temp/humidity sensor on D2

// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
h = dht.readHumidity();
t = dht.readTemperature();
t = (t*1.8)+32; //C to F conversion

String tempVal = doubleToString(t, 2);
String humVal = doubleToString(h, 0);
// String sensorVal = String(1.234);

// convert the reading to a char array
tempVal.toCharArray(tempPrintout, 6);
humVal.toCharArray(humPrintout, 6);

// set the font color
TFTscreen.stroke(255,255,255);
// print the sensor value
TFTscreen.text(tempPrintout, 0, 25);
TFTscreen.text(humPrintout, 0, 85);
// wait for a moment
delay(cycleTime);
// erase the text you just wrote
TFTscreen.stroke(0,0,0);
TFTscreen.text(tempPrintout, 0, 25);
TFTscreen.text(humPrintout, 0, 85);
}

//Rounds down (via intermediary integer conversion truncation)
String doubleToString(double input,int decimalPlaces){
if(decimalPlaces!=0){
String string = String((int)(input*pow(10,decimalPlaces)));
if(abs(input)<1){
if(input>0)
string = "0"+string;
else if(input<0)
string = string.substring(0,1)+"0"+string.substring(1);
}
return string.substring(0,string.length()-decimalPlaces)+"."+string.substring(string.length()-decimalPlaces);
}
else {
return String((int)input);
}
}

Danke für die Hilfe

Habe nun etwas gefunden.
Die Fehlermeldung nun
Arduino: 1.6.1 (Windows 7), Platine: “Arduino Duemilanove or Diecimila, ATmega328”

Adafruit_GFX.h.ino:8:26: fatal error: Adafruit_GFX.h: No such file or directory

compilation terminated.

Fehler beim Kompilieren.

Wo muss ich die fehlende Datei hin kopieren.
Habe einen Ordner Adafruit_GFX-Master in Libr…kopiert wo die Datei drinnen ist.
Aber immer noch die Fehlermeldung

Der Order muss “Adafruit_GFX” heißen

Der Code ist aber nicht sehr schön

Kannst Du mir denn bitte einen besseren schreiben ?

klar macht er das für dich.