Le site référence de tutoriels électroniques français

 
nicolas78
Sujet Auteur
Messages : 1
Inscription : lun. janv. 28, 2019 1:28 pm

BUG Ecran

lun. janv. 28, 2019 1:30 pm

Hi, I have difficulties whith a tft lcd screen ILI9481
My code is perfectly working with the TFT_HX8357-master librairy, but for an unknow reason, the screen have a strange reaction when the loop launches for the second time as you can see on the video, i just want that rectangles stay like in the beggining of the video; the green in the top-left-corner but its not the case....
Im using a TFT ILI9481 screen with an arduino mega
Here is the link to the video: https://drive.google.com/open?id=1oBO7Q ... 0j4QN2Sn4A
Here is my code: 
#define BLACK TFT_BLACK
#define WHITE 0xFFFF
byte q=5;
#include <TFT_HX8357.h>
 
TFT_HX8357 tft = TFT_HX8357();
 
void setup() {
  Serial.begin(250000);
  tft.begin();
  
}
void loop(void) {
testText();
delay(1000);                                                                                                             
}
 
unsigned long testText() {
  tft.drawRect(19,19, 133,133,TFT_WHITE);
tft.fillRect(20,320,130,130, TFT_RED);
tft.fillRect(170,320,130,130, TFT_RED);
tft.fillRect(20,20,130,130, TFT_RED);
tft.fillRect(170,20,130,130, TFT_GREEN);
tft.fillRect(20,170,130,130, TFT_RED);
tft.fillRect(170,170,130,130, TFT_RED);
  //tft.setCursor(306,208);
tft.setTextSize(100);
tft.setTextColor(TFT_YELLOW);
 //tft.println(q);
tft.setCursor(67,55);
tft.setRotation(1);
 tft.setTextSize(10);
 tft.setTextColor(TFT_BLACK);
tft.println("1");
tft.setCursor(220,55);
  tft.setRotation(1);
tft.setTextSize(10);
 tft.setTextColor(TFT_BLACK);
tft.println("2");
tft.setCursor(366,57);
tft.setRotation(1);
tft.setTextSize(10);
 tft.setTextColor(TFT_BLACK);
tft.println("3");
 tft.setCursor(67,208 );
tft.setRotation(1);
tft.setTextSize(10);
 tft.setTextColor(TFT_BLACK);
tft.println("4");
tft.setCursor(220,208);
 tft.setRotation(1);
tft.setTextSize(10);
  tft.setTextColor(TFT_BLACK);
  tft.println("5");
  tft.setCursor(366,208);
  tft.setRotation(1);
tft.setTextSize(10);
  tft.setTextColor(TFT_BLACK);
tft.println("6");}

Qui est en ligne ?

Utilisateurs parcourant ce forum : Aucun utilisateur inscrit et 1 invité
GZIP: Off