dvalero484
Newbie level 6
- Joined
- Oct 20, 2024
- Messages
- 12
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 99
Good day everyone.
So, I'm working on a project of an automatic irrigation system using Arduino Mega 2560 and RTC DS3231, using an ILI9488 TFT 4 wire SPI communication screen for the interface. So far, everything works perfectly when simulating with Proteus 8 (but since there's no ILI9488, I had to use the ILI9341). The real problem is the physically assembly. Everything's connected, but when I upload the code to the Arduino, all I get is a white screen. I've attached what it actually should display on the screen (from the simulation, of course), and you can also check the connections made:
I will also attach the part of the code where the screen is set up. The rest of the code is not important. The weird thing is, sometimes when uploading the code, it shows something on the screen for a brief moment, then immediately goes white. It displays what it should, but incompletely, as if it didn't load properly. Sometimes it just shows a weird gray band in different parts of the screen. And other times it shows everything perfectly for a short moment and then goes white. I can't show you this specific problem because it only happens once in a while when uploading the code to the Arduino, and it's only for a few seconds, as I said before.
I tried also the code examples that come with the ILI9488 library and got the same thing.
Thank you in advance.
So, I'm working on a project of an automatic irrigation system using Arduino Mega 2560 and RTC DS3231, using an ILI9488 TFT 4 wire SPI communication screen for the interface. So far, everything works perfectly when simulating with Proteus 8 (but since there's no ILI9488, I had to use the ILI9341). The real problem is the physically assembly. Everything's connected, but when I upload the code to the Arduino, all I get is a white screen. I've attached what it actually should display on the screen (from the simulation, of course), and you can also check the connections made:
I will also attach the part of the code where the screen is set up. The rest of the code is not important. The weird thing is, sometimes when uploading the code, it shows something on the screen for a brief moment, then immediately goes white. It displays what it should, but incompletely, as if it didn't load properly. Sometimes it just shows a weird gray band in different parts of the screen. And other times it shows everything perfectly for a short moment and then goes white. I can't show you this specific problem because it only happens once in a while when uploading the code to the Arduino, and it's only for a few seconds, as I said before.
Code:
#include <ILI9488.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <RTClib.h>
#include <EEPROM.h>
RTC_DS3231 rtc; // SDA a pin A4 y SCL a pin A5
#include <FreeDefaultFonts.h>
#define pulsador 3
#define valvula_1 12
#define BLACK ILI9488_BLACK
#define RED ILI9488_RED
#define GREEN ILI9488_GREEN
#define WHITE ILI9488_WHITE
#define TFT_CS 8
#define TFT_DC 9
#define TFT_RST 10
#define SD_CS 4
ILI9488 tft = ILI9488(TFT_CS, TFT_DC, TFT_RST);
void setup() {
//Initialize EEPROM for the first time
if (EEPROM.read(EEPROM_hora_Inicio) != 255 || EEPROM.read(EEPROM_lunes) != 255)
readEEPROM();
else
writeEEPROM();
// Initialize RTC
if(!rtc.begin()){
Serial.println("¡Modulo RTC no encontrado!");
for(;;); //bucle
}
// Set up RTC only if time is not initialized
if (rtc.lostPower()) {
Serial.println("Setting up RTC with the compilation time...");
setRTCTimeFromCompileTime();
}
// Initialize TFT
tft.begin();
tft.setRotation(1);
tft.fillScreen(WHITE);
tft.setTextColor(BLACK,WHITE);
}
.
.
.
I tried also the code examples that come with the ILI9488 library and got the same thing.
Thank you in advance.
Last edited: