TFT Screen 2.2" only using a small part of its screen...

The adafruit tft screen (full name 2.2" 320x240 TFT Breakout) seems to be working fine except for the fact its not using the full 320x240 display… I don’t have aspect ratios in my code but I’m not even sure that is the issue… So far its displaying an image from the micro SD card but only top right of the screen… please help.


// include the necessary libraries
#include <SPI.h>
#include <SD.h>
#include <TFT.h> // Arduino LCD library

// pin definition for the Uno
#define sd_cs 4
#define lcd_cs 10
#define dc 9
#define rst 8

// pin definition for the Leonardo
//#define sd_cs 8
//#define lcd_cs 7
//#define dc 0
//#define rst 1

TFT TFTscreen = TFT(lcd_cs, dc, rst);

// this variable represents the image to be drawn on screen
PImage logo;

void setup() {
// initialize the GLCD and show a message
// asking the user to open the serial line
TFTscreen.background(255, 255, 255);

TFTscreen.stroke(0, 0, 255);
TFTscreen.println(F(“Arduino TFT Bitmap Example”));
TFTscreen.stroke(0, 0, 0);
TFTscreen.println(F(“Open serial monitor”));
TFTscreen.println(F(“to run the sketch”));

// initialize the serial port: it will be used to
// print some diagnostic info
while (!Serial) {
// wait for serial port to connect. Needed for native USB port only

// clear the GLCD screen before starting
TFTscreen.background(255, 255, 255);

// try to access the SD card. If that fails (e.g.
// no card present), the setup process will stop.
Serial.print(F(“Initializing SD card…”));
if (!SD.begin(sd_cs)) {

// initialize and clear the GLCD screen
TFTscreen.background(255, 255, 255);

// now that the SD card can be access, try to load the
// image file.
logo = TFTscreen.loadImage(“miniwoof.bmp”);
if (!logo.isValid()) {
Serial.println(F(“error while loading miniwoof.bmp”));

void loop() {
// don’t do anything if the image wasn’t loaded correctly.
if (logo.isValid() == false) {

Serial.println(F(“drawing image”));

// get a random location where to draw the image.
// To avoid the image to be draw outside the screen,
// take into account the image size.
int x = random(TFTscreen.width() - logo.width());
int y = random(TFTscreen.height() - logo.height());

// draw the image to the screen
TFTscreen.image(logo, x, y);

// wait a little bit before drawing again

Just run through all the library examples. You will soon get the hang of your new display.

You can edit the name of the BMP file to display. e.g. "miniwoof.bmp" to "woof.bmp".
This will be a full size image.

The Adafruit library works fine. But there are several other compatible libraries available.


Hey David, i have tried them all I’m getting this consistent issue… (will attach an image)

I am surprised that you got anything. The <TFT.h> library is for 128x160 ST7735 displays. I presume that your 240x320 has got an ILI9341.

Since you have bought a genuine Adafruit display, why not use the genuine Adafruit examples that come with the Adafruit library(s) ?

Incidentally, I ran your program on a real ST7735 display. It displayed the dog, but the colours were wrong.

When you are happy with the Adafruit libraries, we can show you some other libraries.
But I would definitely start with Adafruit.

Oh, and when you are running ok, it will be interesting to see if you actually have an ILI9340C or an ILI9341 controller. Don’t worry. The 9340 and 9341 are almost identical.