TFT 2.8 no funciona con Arduino MEGA

Soy nuevo en el mundo de la electronica y quiero conectar un 2.8 TFT LCD Shield a un arduino MEGA, en el arduino UNO va sin problemas pero en el MEGA 2560 solo se queda en blanco.

Al checar con codigo parece que no hay "Driver LCD".

Asi mismo he usado un TFT_320QDT con un TFT LCD MEGA shield para regular la energia pero sigue quedandose en blanco

Si no proporciona una copia de su "Sketch", será imposible para cualquiera adivinar cuál es el problema. También proporcione cómo lo tiene conectado en el UNO vs el MEGA

Evidentemente tu TFT es SPI y estas conectando al MEGA usando los mismos pines que en el UNO y resulta que en el MEGA los pines SPI estan de 50 a 53. Revisa

#include <Adafruit_GFX.h>
#include <Adafruit_GrayOLED.h>
#include <Adafruit_SPITFT.h>
#include <Adafruit_SPITFT_Macros.h>
#include <gfxfont.h>

#include <Adafruit_TFTLCD.h>

#include <SoftwareSerial.h>
SoftwareSerial SUART (10,11);

   

#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0

#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin

// CREACION DE COLORES PARA LCD:
#define BLACK  0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);


void setup(void) {

  //Serial para LCD
  Serial.begin(115200);
  SUART.begin(115200); 

  delay(500);

  
  //-------------------------------------------PARA SABER QUE CHIP ES EL DE LA PANTALLA-------------------------------
  
  Serial.print("TFT size is "); Serial.print(tft.width()); Serial.print("x"); Serial.println(tft.height());

  tft.reset();

  uint16_t identifier = tft.readID();

  if(identifier == 0x9325) {
    Serial.println(F("Found ILI9325 LCD driver"));
  } else if(identifier == 0x9328) {
    Serial.println(F("Found ILI9328 LCD driver"));
  } else if(identifier == 0x7575) {
    Serial.println(F("Found HX8347G LCD driver"));
  } else if(identifier == 0x9341) {
    Serial.println(F("Found ILI9341 LCD driver"));
  } else if(identifier == 0x8357) {
    Serial.println(F("Found HX8357D LCD driver"));
  
   
  } else {
   // Serial.print(F("Unknown LCD driver chip: "));
   // Serial.println(identifier, HEX);
   //Serial.println(F("If using the Adafruit 2.8\" TFT Arduino shield, the line:"));
    //Serial.println(F("  #define USE_ADAFRUIT_SHIELD_PINOUT"));
    //Serial.println(F("should appear in the library header (Adafruit_TFT.h)."));
    //Serial.println(F("If using the breakout board, it should NOT be #defined!"));
    //Serial.println(F("Also if using the breakout, double-check that all wiring"));
    //Serial.println(F("matches the tutorial."));

     Serial.println(identifier);
    return;
  }
  

//-----------------------------------------------------------------------------------------------------------------------------------

tft.begin(identifier);

  
  
  Serial.println(testFillScreen());
  delay(500);

  Serial.print(F("Text                     "));
  Serial.println(Logo());
  delay(200);
  
  
  Serial.println(F("Done!"));
}

void loop(void) {
 Slogan();
 delay(1500);
 NoSlogan();
 delay(1500);

    byte n = SUART.available();
    
  if(n != 0){
    char data = SUART.read();
    Serial.println(data);
  }

}

unsigned long testFillScreen() {
  unsigned long start = micros();
  tft.fillScreen(RED);
  delay(1000);
  tft.fillScreen(BLACK);
  return micros() - start;
}

unsigned long Logo() {
  tft.fillScreen(RED);
  
  unsigned long start = micros();
  tft.setCursor(65,35);
  tft.setTextColor(WHITE);    tft.setTextSize(4);
  tft.println("BANCO");
  tft.setCursor(33,75);
  tft.setTextColor(WHITE);    tft.setTextSize(5);
  tft.println("ORACLE");
  tft.drawLine(40,155,200,155,WHITE);
  tft.println();
  return micros() - start;
}


unsigned long Slogan() {
  unsigned long start = micros();
  tft.setCursor(60,210);
  tft.setTextColor(WHITE);     tft.setTextSize(2);
  tft.print("Bienvenido");
  return micros() - start;
}

unsigned long NoSlogan() {
 unsigned long start = micros();
  tft.setCursor(60,210);
  tft.setTextColor(RED);     tft.setTextSize(2);
  tft.print("Bienvenido");
  return micros() - start;
}


Ese seria el codigo utilizado

la finalidad del proyecto es utilizar un RFID junto un NODEMCU y que los resultados los muestre en una TFT, no he tenido exito con la conexion de estos tres elementos podrian auxiliarme ?

Dijiste que usabas un MEGA y que la TFT te funcionaba con el UNO, ahora resulta que usas un Nodemcu? con que nos quedamos?

uso un TFT con un Arduino UNO y funciona, muestra lo del codigo que esta mas arriba pero quiero utilizar un RFID para identificar a un usuario y que esa informacion se muestre en el TFT sin embargo con el Arduino UNO me faltan pines para hacer mas conexiones :frowning:

El nodeMCU lo estoy ocupando para enviar datos a MYSQL, mismos que seran utilizados para mostrarlos en el TFT.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.