Ok I've designed a new program to load readouts from a DHT11 on a Adafruit (ST7735) 1.8" TFT LCD Shield w/ joystick and micro SD slot. And I've already hit a mild bump in programming this, a LCD handles a bit different than a true TFT LCD, as the pixels hang as long as the screen is not refilled so it makes the readouts unreadable when they update. So for right now I've added to the screen fill into the loop to help redraw the whole screen, plus whatever doesn't actively update with the DHT11. Does anyone know a simple line of code to remove the pixels in the area in which my readouts are to be printed so as not to make a mass of them and make it unreadable?
Here is the sample code in which I wrote for right now. I just wanted to sample scaling and everything with the TFT LCD. I just plugged in other bits of code from an older sample sketch to handle the DHT11.
#define cs 10
#define dc 8
#define rst -1
#define DHT11PIN 2
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>
#include <dht11.h>
dht11 DHT11;
Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);
void setup() {
tft.initR(INITR_REDTAB);
}
void loop() {
tft.fillScreen(ST7735_BLACK);
tft.setCursor(35, 0);
tft.setTextColor(ST7735_RED);
tft.print("* Farhenheit");
tft.setTextColor(ST7735_BLUE);
tft.setCursor(15, 50);
tft.print("% Humidity");
int chk = DHT11.read(DHT11PIN);
tft.setTextColor(ST7735_RED);
tft.setCursor(0, 0);
tft.print(Fahrenheit(DHT11.temperature));
tft.setTextColor(ST7735_BLUE);
tft.setCursor(0, 50);
tft.print(DHT11.humidity);
delay(5000);
}
double Fahrenheit(double celsius)
{
return 1.8 * celsius + 32;
}