1.8 spi tft Neige sur une partie de l'ecran

Bonjour a vous et bonne annee
j'ai un soucis avec mon montage (ou plutot avec le mon code)
je suis en train dse monter une sonde d'humidité / temperature a base de dht11 + relais + ecran tft1.8"
(je suis loin d'etre un expert en programation ! c'est pour ca que je suis là) le code je l'ai trouver sur le net !!!
tout fonctionne bien sauf un petit soucis d'affichage qui me met de la neige sur le coté de l'ecran (hors mis l'estetique ca ne gene pas! mais bon...)

voici le code...

// Hygromètre et thermostat
// By jojo Bricolo
// Librairie adafruit téléchargeable ici https://github.com/adafruit/DHT-sensor-library
// Datasheet DHT 22 http://www.adafruit.com/datasheets/DHT22.pdf



#include "DHT.h"
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h> 
#include <SPI.h>
#include "Wire.h"

#define sclk 13 //SCL  5 CLK
#define mosi 11 // SDA 4 DIN
#define TFT_CS   9 // CS   2 CS
#define TFT_DC   8 // RS  3 D/C
#define TFT_RST  7  //     1 RST  peut être connecté a la RAZ arduino


Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS,  TFT_DC, TFT_RST);
#define DHTPIN 2
// Décocher le type de capteur utilisé
#define DHTTYPE DHT11   // DHT 11 
//#define DHTTYPE DHT22   // DHT 22  (AM2302)
//#define DHTTYPE DHT21   // DHT 21 (AM2301)

// Pin 1 (a gauche) +5V
// Pin 2 data DHTPIN 
// Pin 4 Masse
// Mettre une ésistance de 10K entre les Pins 1 et 2

DHT dht(DHTPIN, DHTTYPE);
const int intTimePause = 3000; //Par défaut on actualise les valeures toutes les 5 secondes

//int alam = 9;
int shumi = 3;
int stem = 4;
int humi_cons = 50; // Consigne humidité
int temp_cons = 20; // Consigne temperature

void setup() {
  Serial.begin(9600); 
  //Serial.println("DHTxx test!");
  pinMode (shumi,OUTPUT);
   pinMode (stem,OUTPUT);
  Serial.begin(9600);
  tft.initR(INITR_REDTAB);   // initialise le ST7735R
  tft.setRotation(1); 
  tft.fillScreen(ST7735_BLACK);                 //0x0000);
  dht.begin();
  
}

void loop() {
  
  float h = dht.readHumidity();
  float t = dht.readTemperature();

  
  //xxxxxxxxxxx Affichagexxxxxxxxxxx
  tft.setTextSize(2);
   tft.setCursor(10, 10);
  tft.setTextColor(ST7735_MAGENTA);
    tft.print("Temperature");
  tft.setTextColor(ST7735_WHITE);
   tft.setTextSize(2);
   tft.setCursor(30, 30); 
  tft.fillRect (0,30,100,20,0x0000);
    tft.print(t);
  tft.print("C");
   tft.setTextSize(2);
  tft.setTextColor(ST7735_YELLOW);
  tft.setCursor(20,60);
  tft.print("Humidite");
   tft.setCursor(30,80);
   tft.setTextColor(ST7735_CYAN);
  tft.fillRect (0,80,100,20,0x0000);
  tft.print(h);
  tft.print("%");
   tft.setTextSize(1);
  tft.setTextColor(ST7735_RED);
  tft.setCursor(30,115);
  tft.print("By Dede");
  
  
  //xxxxxxxxxxxAffichage  Moniteur serie ou bluetooth xxxxxxxxxxx
  
  Serial.print ("Humidite  ");
  Serial.println (h);
  
   Serial.print ("Temperature  ");
  Serial.println (t);
   Serial.println(" ");

  if (digitalRead(shumi)==HIGH)
  {
    Serial.println ("Ventilateur en marche");
  }
  else
  {
    Serial.println ("Ventilateur arret");
  }
  Serial.println(" ");
  
  if (digitalRead(stem)==HIGH)
  {
    Serial.println ("Chauffage en marche");
  }
  else
  {
    Serial.println ("Chauffage arret");
    Serial.println(" ");
  }
  
  Serial.println(" ");
 Serial.println(" ");
  
  //xxxxxx Commande des relaisxxxxx
  
      // humidité
    if (h >= (humi_cons + 2.00))// Si la mesure h est >ou+ a la consigne +2.00 allumage extracteur
  {
    digitalWrite (shumi,LOW);   // Si la mesure h est < a la consigne +1.00 arret extracteur
  }
  else 
  if (h < (humi_cons - 1))
  {
    digitalWrite (shumi,HIGH);
  
  }
  
  //xxxxxx Temperaturexxxx
  
 if (t >= (temp_cons + 2)) // Si la mesure t est >ou+ a la consigne +2.00 allumage chauffage
  {
    digitalWrite (stem,LOW);
  }
  else 
  if (t < (temp_cons + 1)) // Si la mesure t est < a la consigne +1.00 arret chauffage
  {
    digitalWrite (stem,HIGH);
  } 
  delay (intTimePause);
  }

et voici une photo pour vous montrer le probleme

Si quelqu'un a une idée qu'il n'hésite pas
merci d'avance

ps j'ai acheter cet ecran sur banggood ...

On ne voit pas la photo.

oups c'est un liens de G+ je suppose que si je partage ca va aller mieux :smiley:

Avec tft.fillRect() est ce que tu arrives à remplir la zone en neige ?

et je doit y metre quel parametres ??

personnes pour un petit coup de main ? :,-(

en chipotant et en essayant de trouver solution a mon probleme j'ai reussi a resoudre le probleme mais je ne sais pas vraiment comment !

vola le code qui va !

// Hygromètre et thermostat
// By jojo Bricolo
// Librairie adafruit téléchargeable ici https://github.com/adafruit/DHT-sensor-library
// Datasheet DHT 22 http://www.adafruit.com/datasheets/DHT22.pdf



#include "DHT.h"
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h> 
#include <SPI.h>
#include "Wire.h"

#define sclk 13 //SCL  5 CLK
#define mosi 11 // SDA 4 DIN
#define TFT_CS   9 // CS   2 CS
#define TFT_DC   8 // RS  3 D/C
#define TFT_RST  7  //     1 RST  peut être connecté a la RAZ arduino


Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS,  TFT_DC, TFT_RST);
#define DHTPIN 2
// Décocher le type de capteur utilisé
#define DHTTYPE DHT11   // DHT 11 
//#define DHTTYPE DHT22   // DHT 22  (AM2302)
//#define DHTTYPE DHT21   // DHT 21 (AM2301)

// Pin 1 (a gauche) +5V
// Pin 2 data DHTPIN 
// Pin 4 Masse
// Mettre une ésistance de 10K entre les Pins 1 et 2

DHT dht(DHTPIN, DHTTYPE);
const int intTimePause = 3000; //Par défaut on actualise les valeures toutes les 5 secondes

//int alam = 9;
int shumi = 3;
int stem = 4;
int humi_cons = 50; // Consigne humidité
int temp_cons = 20; // Consigne temperature

void setup() {
  Serial.begin(9600); 
  //Serial.println("DHTxx test!");
  pinMode (shumi,OUTPUT);
   pinMode (stem,OUTPUT);
  Serial.begin(9600);
  tft.initR (); // Initialisation TFT
  //tft.initR(INITR_REDTAB);   // initialise le ST7735R
  tft.setRotation(1); 
  tft.fillScreen (ST7735_BLACK); // Remplir avec le noir, à savoir supprimer
  //tft.fillScreen(ST7735_BLACK);                 //0x0000);
  dht.begin();
  
}

void loop() {
  
  float h = dht.readHumidity();
  float t = dht.readTemperature();

  tft.fillRect (0,0,160,128,ST7735_BLACK);
  //tft.fillRect(tft.width(160), tft.height(128) , ST7735_BLACK);
  //xxxxxxxxxxx Affichagexxxxxxxxxxx
  tft.setTextSize(2);
   tft.setCursor(10, 10);
  tft.setTextColor(ST7735_MAGENTA);
    tft.print("Temperature");
  tft.setTextColor(ST7735_WHITE);
   tft.setTextSize(2);
   tft.setCursor(30, 30); 
  tft.fillRect (0,30,100,20,0x0000);
    tft.print(t);
  tft.print("C");
   tft.setTextSize(2);
  tft.setTextColor(ST7735_YELLOW);
  tft.setCursor(20,60);
  tft.print("Humidite");
   tft.setCursor(30,80);
   tft.setTextColor(ST7735_CYAN);
  tft.fillRect (0,80,100,20,0x0000);
  tft.print(h);
  tft.print("%");
   tft.setTextSize(2);
  tft.setTextColor(ST7735_RED);
  tft.setCursor(30,100);
  tft.print("By Dede");
  
  
  //xxxxxxxxxxxAffichage  Moniteur serie ou bluetooth xxxxxxxxxxx
  
  Serial.print ("Humidite  ");
  Serial.println (h);
  
   Serial.print ("Temperature  ");
  Serial.println (t);
   Serial.println(" ");

  if (digitalRead(shumi)==HIGH)
  {
    Serial.println ("Ventilateur en marche");
  }
  else
  {
    Serial.println ("Ventilateur arret");
  }
  Serial.println(" ");
  
  if (digitalRead(stem)==HIGH)
  {
    Serial.println ("Chauffage en marche");
  }
  else
  {
    Serial.println ("Chauffage arret");
    Serial.println(" ");
  }
  
  Serial.println(" ");
 Serial.println(" ");
  
  //xxxxxx Commande des relaisxxxxx
  
      // humidité
    if (h >= (humi_cons + 2.00))// Si la mesure h est >ou+ a la consigne +2.00 allumage extracteur
  {
    digitalWrite (shumi,LOW);   // Si la mesure h est < a la consigne +1.00 arret extracteur
  }
  else 
  if (h < (humi_cons - 1))
  {
    digitalWrite (shumi,HIGH);
  
  }
  
  //xxxxxx Temperaturexxxx
  
 if (t >= (temp_cons + 2)) // Si la mesure t est >ou+ a la consigne +2.00 allumage chauffage
  {
    digitalWrite (stem,LOW);
  }
  else 
  if (t < (temp_cons + 1)) // Si la mesure t est < a la consigne +1.00 arret chauffage
  {
    digitalWrite (stem,HIGH);
  } 
  delay (intTimePause);
  }

This library works with the Adafruit 1.8" TFT Breakout w/SD card
----> 1.8 Color TFT LCD display with MicroSD Card Breakout [ST7735R] : ID 358 : $19.95 : Adafruit Industries, Unique & fun DIY electronics and kits
The 1.8" TFT shield
----> Adafruit 1.8 Color TFT Shield w/microSD and Joystick [v 2] : ID 802 : $34.95 : Adafruit Industries, Unique & fun DIY electronics and kits
The 1.44" TFT breakout
----> Adafruit 1.44 Color TFT LCD Display with MicroSD Card breakout [ST7735R] : ID 2088 : $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits
as well as Adafruit raw 1.8" TFT display
----> 1.8 SPI TFT display, 160x128 18-bit color - ST7735R driver : ID 618 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits

tft.initR (); // Initialisation TFT
//tft.initR(INITR_REDTAB); // initialise le ST7735R

on dirait que sur la premiere photo il est déclaré comme un 1.44
c'est un tft adafruit ?

non une copie chinoise mais qui fonctionne tres bien avec les exemples de adafruit !

tft.initR (); // Initialisation TFT
//tft.initR(INITR_REDTAB); // initialise le ST7735R

sauf que les copies chinoises ne connaisssent pas REDTAB BLACKTAB et GREENTAB

braves copies chinoises qui fonctionnent : en 5 volts ou en 3v3 sur les i/o ?
le module d adafruit comporte un level shifter, le clone : je ne pense pas ?