drawPixel for 480x320 BMP image producing vertical white lines #3862
Unanswered
Christopher9Ernest
asked this question in
Q&A - Fonts
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have 480x320 TFT touch Screen that uses ILI9488 display chip and XPT2046 touchscreen. I have connected it to Arduino mega 2560 and connected it to SD card. I have written a code to read a 480x320 BMP file in the card and display it on the screen using TFT_eSPI library. When I run the code, the image appears on the screen with vertical white lines. How can I remove the vertical lines?
I have supplied the original code and the photo of the display.
Thanks
Chris.
#include <TFT_eSPI.h>
#include <SPI.h>
#include <SD.h>
#include <XPT2046_Touchscreen.h>
#define SD_CS 6 // SD card chip select
#define TS_CS 7 //Touch Screen Chip Select
//TFT chip select no 53
TFT_eSPI tft = TFT_eSPI();
XPT2046_Touchscreen ts(TS_CS);
int tftWidth, tftHeight;
class BitmapHandler
{
private:
bool fileOK = false;
File bmpFile;
String bmpFilename;
public:
};
void setup()
{
// put your setup code here, to run once:
Serial.begin(115200);
while (!Serial) delay(10);
// TFT init
tft.init();
tft.setRotation(3); // 480x320 landscape
tft.fillScreen(TFT_BLACK);
tft.setTextColor(TFT_WHITE);
tft.setTextSize(2);
tft.drawString("BMP Test", 20, 20);
ts.begin();
ts.setRotation(3);
if(!SD.begin(SD_CS))
{
Serial.println("SD Card Initialization Failed!!");
while(true)
{
;
}
}
else
{
Serial.println("SD Card OK!!");
}
BitmapHandler bmh = BitmapHandler("480x320.bmp");
bmh.serialPrintHeaders();
bmh.renderImage(tft, 0, 0);
}
void loop()
{
// put your main code here, to run repeatedly:
}
SD_Card_Image_Code.docx

OriginalImage.bmp
Beta Was this translation helpful? Give feedback.
All reactions