ILI9341_due
A library for interfacing with ILI9341-based TFT's in SPI, Extended SPI and DMA SPI mode optimized for Arduino Due.

The library can also be used with Arduino AVR boards like Uno, Mega, Pro Mini, Nano, etc. It is faster than the original Adafruit one but do not expect DMA-like speed increase. It is comparable to some other tweaked Adafruit libraries out there and in addition you get things like custom fonts, arcs, images or ability to take screenshots. Btw. Not all library examples will work because of smaller ROM/RAM space available on AVRs.

This library is based on 3 libraries:
ili9341_t3 from Paul Stoffregen - https://github.com/PaulStoffregen/ILI9341_t3
SdFat from Bill Greiman - https://github.com/greiman/SdFat
GLCD from Michael Margolis and Bill Perry - https://code.google.com/p/glcd-arduino
ili9341_t3 library where various optimizations for Adafruit's ili9341 and GFX libraries were implemented was used as a base for ili9341_due.
One class from SdFat library is used for utilizing Due's DMA in SPI transfers which provides the main speed boost.
gText class from GLCD library was used as a base for rendering custom fonts.
As for the wiring, use Due's and AVR's HW SPI pins (e.g. described here). The pin for CS on Due depends on the SPI mode you choose (see SPI Mode section below for details).
ILI9341_due_config.h
Some of the default settings can be set in ILI9341_due_config.h file.
SPI Mode
// comment out the SPI mode you want to use
//#define ILI9341_SPI_MODE_NORMAL
//#define ILI9341_SPI_MODE_EXTENDED // make sure you use pin 4, 10 or 52 for CS
#define ILI9341_SPI_MODE_DMA
Uncomment the line depending on the SPI mode you want to use. DMA mode is the default. For AVR, it does not matter which mode you use, ILI9341_SPI_MODE_NORMAL is always going to be used since there is no Extended SPI or DMA available on AVRs.
SPI_MODE_NORMAL is the standard SPI mode where you can use any digital pin for CS. In this mode the library will drive the CS pin 'manually'.
SPI_MODE_EXTENDED is the extended SPI mode available in Due the CS pin is handled by the chip (which is faster than handling it in code 'manually'). You are restricted to these 3 pins for CS - 4, 10 and 52 (as described here).
SPI_MODE_DMA is utilizing D(irect) M(emory) A(ddress) to do SPI transfers. You can use use any digital pin for CS.
Here is a video where you can see the speed difference between the modes (v0.x version):
SPI clock divider
For Due:#define ILI9341_SPI_CLKDIVIDER 2 // for Due
This is used to set the SPI clock frequency on Due, which for example when set to 10 will set the SPI clock frequency to 84MHz/10=8.4MHz. The minimum divider is 1 (84MHz) and maximum is 255 (329kHz). If you are getting glitches on the screen or it just does not work try to use a higher divider to bring the frequency down (e.g. 11 to run it at 8-ish MHz). I was using 20cm dupont cables to connect TFT with Due and haven't had any issues running it with the divider set to 2.
For AVR:#define ILI9341_SPI_CLKDIVIDER SPI_CLOCK_DIV2 // for Uno, Mega,...
This is used to set the SPI clock frequency on AVR based boards (Uno, Mega,...). You can use one of these values:
- SPI_CLOCK_DIV2 - divider of 2
- SPI_CLOCK_DIV4 - divider of 4
- SPI_CLOCK_DIV8 - divider of 8
- SPI_CLOCK_DIV16 - divider of 16
- SPI_CLOCK_DIV32 - divider of 32
- SPI_CLOCK_DIV64 - divider of 64
- SPI_CLOCK_DIV128 - divider of 128
Text
#define TEXT_SCALING_ENABLED
If you do not need scaled fonts (setTextScale function) then you can comment out the define to disable support for text scaling. Text will render a bit faster. Text scaling is enabled by default.
Scaled font:
#define DEFAULT_LETTER_SPACING 2
Set the default spacing between letters in pixels.
Different letter spacings:
#define DEFAULT_LINE_SPACING 0
Set the default spacing between lines in pixels.
Different line spacings:
#define LINE_SPACING_AS_PART_OF_LETTERS
If uncommented, the space between lines (defined by DEFAULT_LINE_SPACING) is filled with text background color. By default it is commented out/disabled.
If uncommented/enabled:
Arcs
#define ARC_ANGLE_MAX 360
This number represents the maximum equal to 360 degrees (full circle). The default is 360 so if you pass in start=25 and end=75 you'll get an arc going from 25 degrees to 75 degrees. If you set ARC_ANGLE_MAX 100 and you pass in start=0 and end=50 then you get a half circle (that can represent percentages). If you set ARC_ANGLE_MAX 2*PI, you can pass in angles in radians etc...You can change the default at runtime by calling the setArcParams function.
#define ARC_ANGLE_OFFSET -90
This number is an offset in degrees from the default position where the arc starts (representing value of 0). If you imagine a compass, then the default starting position is at the East point. Setting the value to -90 will move the starting point 90 degress counter-clockwise (so to the North point).
You can change the offset at runtime by calling the setAngleOffset function. The value provided in setAngleOffset argument is *in addition* to ARC_ANGLE_OFFSET value. So the total angle offset from the default East point is ARC_ANGLE_OFFSET+setAngleOffset value.
Creating Custom Fonts
You can create your own font files by using GLCDFontCreator2 tool. It generates .h files that can then be included in your sketch and the font can be set by the setFont function.
The maximum height of a font can be 255 px. GLCDFontCreator2 tool requires Java and it is included in the tools folder or you can dowload it from
here.
Here is a quick guide:
- Open GLCD Font Creator 2.
- From the menu select File->New Font.
- Select the Font, Size and Style you want to import in the Import Font group.
- Set the Start Index, that's the index from the character map. The first character (space) starts at index 32. The numbers start at index 48, upper-case characters at index 65, etc.
- Set the Char Count, that's the number of characters starting at the Start Index you want to have in your character set. So e.g. if you just need the numbers, set the Start Index to 48 and Char Count to 10. That will give you numbers 0-9 in your set.
- Set the Font Name. I advice to use maximum of 8 characters, no spaces.
- Click OK.
- From the menu select Export->Export Font.
- Provide a file name. No spaces and the same name as in step 6. Also add ".h" to your file name so you do not have to add it afterwards.
- When you click Save, the app starts to export but there is no visible progress. If you do not see the file immediately, just wait for it.
- Copy the .h file where your sketch is (or wherever you can find it).
- Add an include in your sketch, #include "name_from_step_9.h".
- Call tft.setFont(name_from_step_6) and tft.print to render the text.
Custom fonts on AVR (important!)
In order to use generated fonts on Uno, Mega,... you need to manually modify the generated .c file to make it succesfully compile. After you generate a .c file the array definition will look something like this:static uint8_t Arial_14[] PROGMEM = {
If you do not change anything the compiler will complain with:
error: variable 'Arial_14' must be const in order to be put into read-only section by means of '__attribute__((progmem))'In order to fix it you need to add "const" so it will look like this:
static const uint8_t Arial_14[] PROGMEM = {
Here is a video of rendering a 255px-high font:
Demos
Loading images from an SD card
This is the SdFatTftBitmap example sketch demonstrating loading images from an SD card. The images were converted to RGB565 format using BMP24toILI565 tool (see the Tools folder). One image loads and displays in around 160ms using half speed for SD card SPI and half speed for Due SPI. I was getting distorted images when I tried to use the full speed for either of the SPIs.
This is the Arcs demo from the examples folder:
UTFT demo speed comparison
All the credits (and blame :) goes to TFTLCDCyg who ported the UTFT demo to ILI9341_due library. Both demos were run on Due at the max speed.
Here is a video of the demo powered by the UTFT library:
And here is the demo powered by the ILI9341_due library:
The source code for the ILI9341_due-fied demo can be found in the library's examples folder. Done with ILI9431_due v0.x version. The demo completes in around 1080ms with ILI9341_due v1.x version.
ILI9341_due_Buttons add-on library
Created by Graham Lawrence (aka ghlawrence2000). It's an add-on library which allows to easily add buttons to the UI. See his GitHub page for more information.
Here are videos of two of his example sketches:
ILI9341 functions
Functions summary (in alphabetical order)
Functions details

- x - x-coordinate
- y - y-coordinate
- color - pixel color

- x0 - x-coordinate of the starting point
- y0 - y-coordinate of the starting point
- x1 - x-coordinate of the ending point
- y1 - y-coordinate of the ending point
- color - line color

void drawLineByAngle(int16_t x, int16_t y, int16_t angle, uint16_t start, uint16_t length, uint16_t color);
- x - x-coordinate of the starting point
- y - y-coordinate of the starting point
- angle - line angle
- start - offset from the starting point (optional)
- lenght - line lenght
- color - line color
tft.drawLineByAngle(100, 100, 90, 10, 50, ILI9341_RED);

- x - x-coordinate of the starting point
- y - y-coordinate of the starting point
- w - line width (line is drawn from left to right)
- color - line color

- x - x-coordinate of the starting point
- y - y-coordinate of the starting point
- h - line height (line is drawn from top to bottom)
- color - line color

- x - x-coordinate of the rectangle top left corner
- y - y-coordinate of the rectangle top left corner
- w - rectangle width
- h - rectangle height
- color - rectangle color

- x - x-coordinate of the rectangle top left corner
- y - y-coordinate of the rectangle top left corner
- w - rectangle width
- h - rectangle height
- color - rectangle fill color

- x - x-coordinate of the rectangle top left corner
- y - y-coordinate of the rectangle top left corner
- w - rectangle width
- h - rectangle height
- radius - corner radius
- color - rectangle color

- x - x-coordinate of the rectangle top left corner
- y - y-coordinate of the rectangle top left corner
- w - rectangle width
- h - rectangle height
- radius - corner radius
- color - rectangle fill color

- x - x-coordinate of the circle center
- y - y-coordinate of the circle center
- r - circle radius
- color - circle color

- x - x-coordinate of the circle center
- y - y-coordinate of the circle center
- r - circle radius
- color - circle fill color

- x - x-coordinate of the arc center
- y - y-coordinate of the arc center
- radius - arc radius
- thickness - arc inward thickness
- start - arc start angle
- end - arc end angle
- color - arc fill color
A red pie with center at (160,100), 20px radius, starting at 45 degrees and ending at 270 degrees.
tft.fillArc(160, 100, 20, 20, 45, 270, ILI9341_RED);

- x0 - x-coordinate of triangle 1st corner
- y0 - y-coordinate of the triangle 1st corner
- x1 - x-coordinate of triangle 2nd corner
- y1 - y-coordinate of the triangle 2nd corner
- x2 - x-coordinate of triangle 3rd corner
- y2 - y-coordinate of the triangle 3rd corner
- color - triangle color

- x0 - x-coordinate of triangle 1st corner
- y0 - y-coordinate of the triangle 1st corner
- x1 - x-coordinate of triangle 2nd corner
- y1 - y-coordinate of the triangle 2nd corner
- x2 - x-coordinate of triangle 3rd corner
- y2 - y-coordinate of the triangle 3rd corner
- color - triangle fill color

void drawBitmap(const uint8_t *bitmap, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color, uint16_t bgcolor);
- bitmap - a pointer to a byte array (in progmem for AVR) holding pixel data
- x - x-coordinate of the bitmaps's top left corner
- y - y-coordinate of the bitmaps's top left corner
- w - bitmap width (in pixels)
- h - bitmap height (in pixels)
- color - bitmap color (a color that will be used for drawing pixels where the corresponding bit in the array is set to 1)
- bgColor - bitmap's background color (optional) (a color that will be used for drawing pixels where the corresponding bit in the array is set to 0). If not specified then the background is transparent.
B00000000, B00000000, B00000000, B00000000, B01111110,"
...
B10001010, B00101111, B00011100, B11100100, B01001110
};
...
tft.drawBitmap(arduLogo, 110, 100, 40, 32, ILI9341_WHITE, ILI9341_DARKCYAN); // solid background
tft.drawBitmap(arduLogo, 160, 100, 40, 32, ILI9341_DARKCYAN); // transparent background

- colors - a pointer to an array (in progmem for AVR) holding pixel colors
- x - x-coordinate of the image top left corner
- y - y-coordinate of the image top left corner
- w - image width, you can use the constant generated by BMP24toILI565Array tool which is called the same as the colors array with Width appended at the end (so if colors array name is myImage then the width of that image is in myImageWidth constant)
- h - image height, you can use the constant generated by BMP24toILI565Array tool which is called the same as the colors array with Height appended at the end (so if colors array name is myImage then the height of that image is in myImageHeight constant)
#include "alert.h"
#include "close.h"
...
tft.drawImage(info, 100, 100, infoWidth, infoHeight);
tft.drawImage(alert, 140, 100, alertWidth, alertHeight);
tft.drawImage(close, 180, 100, closeWidth, closeHeight);

- i - if true colors are inverted, if false - colors are normal

- x - x-coordinate of the upper left corner of the drawing window
- y - y-coordinate of the upper left corner of the drawing window
- w - x-coordinate of the bottom right corner of the drawing window
- h - y-coordinate of the bottom right corner of the drawing window
- x - x-coordinate of the upper left corner of the drawing window
- y - y-coordinate of the upper left corner of the drawing window
- w - drawing window width
- h - drawing window height
- color - pixel color to draw
for (byte y = 0; y < 3; y++) { // 3 lines
for (byte x = 0; x < 40; x++) { // draw 5 pixels (3 white, 2 blue) fourty times (1 line)
tft.pushColor(ILI9341_WHITE);
tft.pushColor(ILI9341_WHITE);
tft.pushColor(ILI9341_WHITE);
tft.pushColor(ILI9341_BLUE);
tft.pushColor(ILI9341_BLUE);
}
}

- colors - a pointer to an array (in progmem for AVR) of pixels/colors
- offset - offset from the beginning of the array
- len - number of pixels to draw from the array
...
tft.setAddrWindowRect(60, 100, 200, 3); // set the drawing window to a 200x3px rectangle
for (byte y = 0; y < 3; y++) { // 3 lines
for (byte x = 0; x < 40; x++) { // draw 5 pixels (3 white, 2 blue) fourty times (1 line)
tft.pushColors(pixels, 0, 5);
}
}

- colors - a pointer to an array of pixels/colors
- offset - offset from the beginning of the array
- len - number of pixels to draw from the array
...
for (byte x = 0; x < 200; x++) { // generate a simple grayscale gradient
uint16_t color = (uint16_t)(255 * x) / 200;
pixels[x] = tft.color565(color, color, color);
}
tft.setAddrWindowRect(60, 100, 200, 3); // set the drawing window to a 200x3px rectangle
for (byte y = 0; y < 3; y++) { // 3 lines
tft.pushColors(pixels, 0, 200); // draw the generated colors
}

- x - x-coordinate of the pixel to read the color from
- y - y-coordinate of the pixel to read the color from
- r - can either be one of these enum values:
- iliRotation0 - portrait mode
- iliRotation90 - landscape mode
- iliRotation180 - portrait mode (rotated by 180 degrees)
- iliRotation270 - landscape mode (rotated by 180 degrees)
- 0 - portrait mode
- 1 - landscape mode
- 2 - portrait mode (rotated by 180 degrees)
- 3 - landscape mode (rotated by 180 degrees)
tft.setRotation(3); // using numeric value
- d - if true pixel display is on (normal mode), if false - pixel display is off (white screen)
- i - if true TFT will be put into idle mode, if false TFT will be restored to normal mode (if it was in idle mode)
- s - if true TFT will be put into sleep mode, if false TFT will be restored to normal mode (if it was in sleep mode)
- p - can be one of these values:
- pwrLevelNormal - normal mode - restores to normal mode (if it was in idle or sleep or both)
- pwrLevelIdle - idle mode - same as calling idle(true)
- pwrLevelSleep - sleep mode - same as calling sleep(true)
- divider
- for Arduino Due - any number between 1 and 255
- for AVR (Uno, Mega,...) one of these values:- SPI_CLOCK_DIV2 - SPI clock frequency is set to (CPU frequency / 2)
- SPI_CLOCK_DIV4 - SPI clock frequency is set to (CPU frequency / 4)
- SPI_CLOCK_DIV8 - SPI clock frequency is set to (CPU frequency / 8)
- SPI_CLOCK_DIV16 - SPI clock frequency is set to (CPU frequency / 16)
- SPI_CLOCK_DIV32 - SPI clock frequency is set to (CPU frequency / 32)
- SPI_CLOCK_DIV64 - SPI clock frequency is set to (CPU frequency / 64)
- SPI_CLOCK_DIV128 - SPI clock frequency is set to (CPU frequency / 128)
tft.setSPIClockDivider(SPI_CLOCK_DIV2); // for Arduino Uno, Mega,... 16MHz/2 = 8MHz
- angleOffset - clockwise offset in degrees from the default start point (North point). Can be a negative number which will offset angle's 0 degree position counter-clockwise from the default start point.
Set the yellow arc angle start point to 45 degrees clockwise from North.
Set the green arc angle start point to default.
tft.fillArc(110, 100, 20, 10, 0, 195, ILI9341_RED);
tft.setAngleOffset(45);
tft.fillArc(160, 100, 20, 10, 0, 195, ILI9341_YELLOW);
tft.setAngleOffset(0);
tft.fillArc(210, 100, 20, 10, 0, 195, ILI9341_GREEN);

- arcAngleMax - sets the max value corresponding to 360 degrees. By default it is set to value defined by ARC_ANGLE_MAX in ILI9341_due_config.h which is 360. You can set it to any float value, so for example if you set it to 1.0 (which will represent the max angle of 360) then calling fillArc with startAngle of 0 and endAngle of 0.5 will get you a half circle.
tft.fillArc(160, 120, 50, 10, 0, 25, ILI9341_WHITE); // draw 25% of a circle

- area - area for drawing the text
gTextArea titleArea{ 10, 10, 300, 40 }; // define a 300px wide and 40px high title area
gTextArea descriptionArea{ 10, 60, 300, 170 }; // define a 300px wide and 170px high description area
...
tft.setFont(Arial_bold_14);
tft.setTextColor(ILI9341_WHITE, ILI9341_DARKBLUE);
...
tft.setTextArea(titleArea);
tft.clearTextArea(ILI9341_LIGHTBLUE); // just to see where the area is
tft.print("My Title");
tft.setTextArea(descriptionArea);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.print("My Description");

- x - x-coordinate of area upper left corner
- y - y-coordinate of area upper left corner
- w - area width
- h - area height
...
tft.setFont(Arial_bold_14);
tft.setTextColor(ILI9341_WHITE, ILI9341_DARKBLUE);
...
tft.setTextArea(10, 10, 300, 40);
tft.clearTextArea(ILI9341_LIGHTBLUE); // just to see where the area is
tft.print("My Title");
tft.setTextArea(10, 60, 300, 170);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.print("My Description");

- x - x-coordinate of area upper left corner
- y - y-coordinate of area upper left corner
- columns - area width in number of columns (the width of the widest character is used to calculate the area width)
- rows - area height in number of rows (the font height is used to calculate area height
- font - font to be used to calculate the area size
...
tft.setFont(Arial_bold_14);
tft.setTextColor(ILI9341_WHITE, ILI9341_DARKBLUE);
...
tft.setTextArea(10, 10, 26, 2, Arial_bold_14); // 26 characters wide and 2 characters high area
tft.clearTextArea(ILI9341_LIGHTBLUE); // just to see where the area is
tft.print("My Title");
tft.setTextArea(10, 60, 26, 7, Arial_bold_14); // 26 characters wide and 7 characters high area
tft.clearTextArea(ILI9341_LIGHTBLUE); // just to see where the area is
tft.print("My Description");

gTextArea descriptionArea{ 10, 60, 300, 170 };
...
tft.setTextColor(ILI9341_WHITE, ILI9341_DARKBLUE);
tft.setTextArea(titleArea);
tft.clearTextArea(); // clear the title area with dark blue color
tft.setTextColor(ILI9341_WHITE, ILI9341_DARKGRAY);
tft.setTextArea(descriptionArea);
tft.clearTextArea(); // clear the description area with dark gray color

- area - text area to clear
gTextArea descriptionArea{ 10, 60, 300, 170 };
...
tft.setTextColor(ILI9341_WHITE, ILI9341_DARKBLUE);
tft.clearTextArea(titleArea); // clear the title area with dark blue color
tft.setTextColor(ILI9341_WHITE, ILI9341_DARKGRAY);
tft.clearTextArea(descriptionArea); // clear the description area with dark gray color

- color - color to clear with
gTextArea descriptionArea{ 10, 60, 300, 170 };
...
tft.setTextArea(titleArea);
tft.clearTextArea(ILI9341_LIGHTBLUE); // clear the title area with light blue color
tft.setTextArea(descriptionArea);
tft.clearTextArea(ILI9341_LIGHTGREEN); // clear the description area with light green color

- area - text area to clear
- color - color to clear with
gTextArea descriptionArea{ 10, 60, 300, 170 };
...
tft.clearTextArea(titleArea, ILI9341_LIGHTBLUE); // clear the title area with light blue color
tft.clearTextArea(descriptionArea, ILI9341_LIGHTGREEN); // clear the description area with light blue color

- font - font to use
#include "fonts\Arial_bold_14.h"
...
gTextArea titleArea{ 10, 10, 300, 40 };
gTextArea descriptionArea{ 10, 60, 300, 170 };
...
tft.setTextColor(ILI9341_WHITE, ILI9341_DARKBLUE);
tft.setTextArea(titleArea);
tft.setFont(Arial_bold_14);
tft.print("My Title");
tft.setTextArea(descriptionArea);
tft.setFont(Arial14);
tft.print("My Description");

- font - font to get the height of
- c - character to get the width of
- c - character to get the width of
- font - font to use for the width calculation
- textScale - text scale to use for the width calculation
- color - text color to use
...
gTextArea titleArea{ 10, 10, 300, 40 };
gTextArea descriptionArea{ 10, 60, 300, 170 };
...
tft.setFont(Arial_bold_14);
tft.setTextArea(titleArea);
tft.setTextColor(ILI9341_RED);
tft.print("My Title");
tft.setTextArea(descriptionArea);
tft.setTextColor(ILI9341_LIME);
tft.print("My Description");

- R - red
- G - green
- B - blue
...
gTextArea titleArea{ 10, 10, 300, 40 };
gTextArea descriptionArea{ 10, 60, 300, 170 };
...
tft.setFont(Arial_bold_14);
tft.setTextArea(titleArea);
tft.setTextColor(255, 0, 0);
tft.print("My Title");
tft.setTextArea(descriptionArea);
tft.setTextColor(0, 255, 0);
tft.print("My Description");

- color - text foreground color
- backgroundColor - text bacground color
...
gTextArea titleArea{ 10, 10, 300, 40 };
gTextArea descriptionArea{ 10, 60, 300, 170 };
...
tft.setFont(Arial_bold_14);
tft.setTextArea(titleArea);
tft.setTextColor(ILI9341_RED, ILI9341_DARKRED);
tft.print("My Title");
tft.setTextArea(descriptionArea);
tft.setTextColor(ILI9341_LIME, ILI9341_BLUE);
tft.print("My Description");

- R - foreground red
- G - foreground green
- B - foreground blue
- bgR - background red
- bgG - background green
- bgB - background blue
...
gTextArea titleArea{ 10, 10, 300, 40 };
gTextArea descriptionArea{ 10, 60, 300, 170 };
...
tft.setFont(Arial_bold_14);
tft.setTextArea(titleArea);
tft.setTextColor(255, 0, 0, 127, 0, 0);
tft.print("My Title");
tft.setTextArea(descriptionArea);
tft.setTextColor(0, 255, 0, 0, 0, 255);
tft.print("My Description");

- letterSpacing - the distance in pixels between characters
...
gTextArea textArea{ 10, 10, 300, 200 };
...
tft.setFont(Arial_bold_14);
tft.setTextArea(textArea);
tft.setTextColor(ILI9341_WHITE, ILI9341_BLUE);
tft.setTextLetterSpacing(0);
tft.print("Letter Spacing 0\n");
tft.setTextLetterSpacing(1);
tft.print("Letter Spacing 1\n");
tft.setTextLetterSpacing(2);
tft.print("Letter Spacing 2\n");
tft.setTextLetterSpacing(3);
tft.print("Letter Spacing 3\n");
tft.setTextLetterSpacing(4);
tft.print("Letter Spacing 4\n");
tft.setTextLetterSpacing(5);
tft.print("Letter Spacing 5\n");
tft.setTextLetterSpacing(6);
tft.print("Letter Spacing 6\n");
tft.setTextLetterSpacing(7);
tft.print("Letter Spacing 7\n");
tft.setTextLetterSpacing(8);
tft.print("Letter Spacing 8\n");
tft.setTextLetterSpacing(9);
tft.print("Letter Spacing 9\n");
tft.setTextLetterSpacing(10);
tft.print("Letter Spacing 10");

- lineSpacing - the distance in pixels between lines
...
gTextArea textArea{ 10, 10, 300, 200 };
...
tft.setFont(Arial_bold_14);
tft.setTextArea(textArea);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.setTextLineSpacing(0);
tft.print("Line Spacing 0\n");
tft.setTextLineSpacing(1);
tft.print("Line Spacing 1\n");
tft.setTextLineSpacing(2);
tft.print("Line Spacing 2\n");
tft.setTextLineSpacing(3);
tft.print("Line Spacing 3\n");
tft.setTextLineSpacing(4);
tft.print("Line Spacing 4\n");
tft.setTextLineSpacing(5);
tft.print("Line Spacing 5\n");
tft.setTextLineSpacing(6);
tft.print("Line Spacing 6\n");
tft.setTextLineSpacing(7);
tft.print("Line Spacing 7\n");
tft.setTextLineSpacing(8);
tft.print("Line Spacing 8\n");
tft.setTextLineSpacing(9);
tft.print("Line Spacing 9\n");
tft.setTextLineSpacing(10);
tft.print("Line Spacing 10\n");
tft.print("Line Spacing end");

- fontMode - can be one of these enum values:
- gTextFontModeTransparent - transparent font background
- gTextFontModeSolid - solid font background (default)
...
gTextArea textArea{ 10, 10, 300, 200 };
...
for (uint32_t i = 0; i < 320; i += 20){
for (uint32_t j = 0; j < 240; j += 20){
tft.fillRect(i, j, 20, 20, random(0,65535));
}
}
tft.setFont(Arial_bold_14);
tft.setTextArea(textArea);
tft.setTextColor(ILI9341_WHITE, ILI9341_GREEN);
tft.setFontMode(gTextFontModeTransparent);
tft.print("gTextFontModeTransparent\n\n");
tft.setFontMode(gTextFontModeSolid);
tft.print("gTextFontModeSolid");

- textScale - text scale multiplier
...
gTextArea textArea{ 10, 10, 300, 200 };
...
tft.setFont(Arial_bold_14);
tft.setTextArea(textArea);
tft.setTextColor(ILI9341_WHITE, ILI9341_BLUE);
tft.setTextScale(1);
tft.print("Text Scale 1\n");
tft.setTextScale(2);
tft.print("Text Scale 2\n");
tft.setTextScale(3);
tft.print("Text Scale 3\n");
tft.setTextScale(4);
tft.print("Text Scale 4\n");
tft.setTextScale(5);
tft.print("Text Scale 5");

- x - x-coordinate of the string top left corner
- y - y-coordinate of the string top left corner
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.cursorToXY(10, 10);
tft.print("String 1");
String str2 = "String 2";
tft.cursorToXY(30, 30);
tft.print(str2);
tft.cursorToXY(50, 50);
tft.print(F("String 3"));

- column - the column where the text cursor will be set
- row - the row where the text cursor will be set
- column - the column where the text cursor will be set
void printAt(const String &str, int16_t x, int16_t y);
void printAt(const __FlashStringHelper* str, int16_t x, int16_t y);
- str - string to print
- x - x-coordinate of the string top left corner
- y - y-coordinate of the string top left corner
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAt("String 1", 10, 10);
String str2 = "String 2";
tft.printAt(str2, 30, 30);
tft.printAt(F("String 3"), 50, 50);

void printAt(const String &str, int16_t x, int16_t y, gTextEraseLine eraseLine);
void printAt(const __FlashStringHelper *str, int16_t x, int16_t y, gTextEraseLine eraseLine);
- str - string to print
- x - x-coordinate (relative to text area) of the string top left corner
- y - y-coordinate (relative to text area) of the string top left corner
- eraseLine - can be one of these enum values:
- gTextEraseFromBOL - erases from the beginning of line
- gTextEraseToEOL - erases to the end of line
- gTextEraseFullLine - erases the whole line
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAt("EraseFromBOL", 100, 10, gTextEraseFromBOL);
String str2 = "EraseToEOL";
tft.printAt(str2, 100, 30, gTextEraseToEOL);
tft.printAt(F("EraseFullLine"), 100, 50, gTextEraseFullLine);

void printAt(const String &str, int16_t x, int16_t y, uint16_t pixelsClearedOnLeft, uint16_t pixelsClearedOnRight);
void printAt(const __FlashStringHelper *str, int16_t x, int16_t y, uint16_t pixelsClearedOnLeft, uint16_t pixelsClearedOnRight);
- str - string to print
- x - x-coordinate (relative to text area) of the string top left corner
- y - y-coordinate (relative to text area) of the string top left corner
- pixelsClearedOnLeft - width in pixels to be cleared on the string left side
- pixelsClearedOnRight - width in pixels to be cleared on the string right side
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAt("<- 10px on left, 10px on right ->", 30, 10, 10, 10);
String str2 = "<- 2px on left, 20px on right ->";
tft.printAt(str2, 30, 30, 2, 20);
tft.printAt(F("<- 30px on left, 5px on right ->"), 30, 50, 30, 5);

void printAtPivoted(const String &str, int16_t x, int16_t y, gTextPivot pivot);
void printAtPivoted(const __FlashStringHelper *str, int16_t x, int16_t y, gTextPivot pivot);
- str - string to print
- x - x-coordinate (relative to text area) of the target pivot location
- y - y-coordinate (relative to text area) of the target pivot location
- pivot - string's pivot location. Can be one of these enum values:
- gTextPivotTopLeft - the pivot is in the top left corner of the string
- gTextPivotTopCenter - the pivot is in the top center of the string
- gTextPivotTopRight - the pivot is in the top right corner of the string
- gTextPivotMiddleLeft - the pivot is in the middle left of the string
- gTextPivotMiddleCenter - the pivot is in the middle center of the string
- gTextPivotMiddleRight - the pivot is in the top middle right of the string
- gTextPivotBottomLeft - the pivot is in the bottom left corner of the string
- gTextPivotBottomCenter - the pivot is in the bottom center of the string
- gTextPivotBottomRight - the pivot is in the bottom right corner of the string
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAtPivoted("PivotTopLeft", 150, 10, gTextPivotTopLeft);
tft.printAtPivoted("PivotTopCenter", 150, 30, gTextPivotTopCenter);
tft.printAtPivoted("PivotTopRight", 150, 50, gTextPivotTopRight);

void printAligned(const String &str, gTextAlign align);
void printAligned(const __FlashStringHelper *str, gTextAlign align);
- str - string to print
- align - alignment of string in respect to text area. Can be one of these values:
- gTextAlignTopLeft - aligning to top left
- gTextAlignTopCenter - aligning to top center
- gTextAlignTopRight - aligning to top right
- gTextAlignMiddleLeft - aligning to midlle left
- gTextAlignMiddleCenter - aligning to midlle center
- gTextAlignMiddleRight - aligning to midlle right
- gTextAlignBottomLeft - aligning to bottom left
- gTextAlignBottomCenter - aligning to bottom center
- gTextAlignBottomRight - aligning to bottom right
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAligned("TopLeft", gTextAlignTopLeft);
tft.printAligned("TopCenter", gTextAlignTopCenter);
tft.printAligned("TopRight", gTextAlignTopRight);
tft.printAligned("MiddleLeft", gTextAlignMiddleLeft);
tft.printAligned("MiddleCenter", gTextAlignMiddleCenter);
tft.printAligned("MiddleRight", gTextAlignMiddleRight);
tft.printAligned("BottomLeft", gTextAlignBottomLeft);
tft.printAligned("BottomCenter", gTextAlignBottomCenter);
tft.printAligned("BottomRight", gTextAlignBottomRight);

void printAligned(const String &str, gTextAlign align, gTextEraseLine eraseLine);
void printAligned(const __FlashStringHelper *str, gTextAlign align, gTextEraseLine eraseLine);
- str - string to print
- align - alignment of string in respect to text area. Can be one of these values:
- gTextAlignTopLeft - aligning to top left
- gTextAlignTopCenter - aligning to top center
- gTextAlignTopRight - aligning to top right
- gTextAlignMiddleLeft - aligning to midlle left
- gTextAlignMiddleCenter - aligning to midlle center
- gTextAlignMiddleRight - aligning to midlle right
- gTextAlignBottomLeft - aligning to bottom left
- gTextAlignBottomCenter - aligning to bottom center
- gTextAlignBottomRight - aligning to bottom right
- eraseLine - can be one of these enum values:
- gTextEraseFromBOL - erases from the beginning of line
- gTextEraseToEOL - erases to the end of line
- gTextEraseFullLine - erases the whole line
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAligned("EraseFromBOL", gTextAlignTopCenter, gTextEraseFromBOL);
tft.printAligned("EraseToEOL", gTextAlignMiddleCenter, gTextEraseToEOL);
tft.printAligned("EraseFullLine", gTextAlignBottomCenter, gTextEraseFullLine);

void printAligned(const String &str, gTextAlign align, uint16_t pixelsClearedOnLeft, uint16_t pixelsClearedOnRight);
void printAligned(const __FlashStringHelper *str, gTextAlign align, uint16_t pixelsClearedOnLeft, uint16_t pixelsClearedOnRight);
- str - string to print
- align - alignment of string in respect to text area. Can be one of these values:
- gTextAlignTopLeft - aligning to top left
- gTextAlignTopCenter - aligning to top center
- gTextAlignTopRight - aligning to top right
- gTextAlignMiddleLeft - aligning to midlle left
- gTextAlignMiddleCenter - aligning to midlle center
- gTextAlignMiddleRight - aligning to midlle right
- gTextAlignBottomLeft - aligning to bottom left
- gTextAlignBottomCenter - aligning to bottom center
- gTextAlignBottomRight - aligning to bottom right
- pixelsClearedOnLeft - width in pixels to be cleared on the string left side
- pixelsClearedOnRight - width in pixels to be cleared on the string right side
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAligned("<- 10px on left, 10px on right ->", gTextAlignTopLeft, 10, 10);
tft.printAligned("<- 2px on left, 20px on right ->", gTextAlignMiddleCenter, 2, 20);
tft.printAligned("<- 30px on left, 5px on right ->", gTextAlignBottomRight, 30, 5);

void printAlignedOffseted(const String &str, gTextAlign align, uint16_t offsetX, uint16_t offsetY);
void printAlignedOffseted(const __FlashStringHelper *str, gTextAlign align, uint16_t offsetX, uint16_t offsetY);
- str - string to print
- align - alignment of string in respect to text area. Can be one of these values:
- gTextAlignTopLeft - aligning to top left
- gTextAlignTopCenter - aligning to top center
- gTextAlignTopRight - aligning to top right
- gTextAlignMiddleLeft - aligning to midlle left
- gTextAlignMiddleCenter - aligning to midlle center
- gTextAlignMiddleRight - aligning to midlle right
- gTextAlignBottomLeft - aligning to bottom left
- gTextAlignBottomCenter - aligning to bottom center
- gTextAlignBottomRight - aligning to bottom right
- offsetX - string offset in x-axis
- offsetY - string offset in y-axis
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAlignedOffseted("Middle", gTextAlignMiddleCenter, 0, 0); // no actual offset
tft.printAlignedOffseted("-90px offset-x", gTextAlignMiddleCenter, -90, 0);
tft.printAlignedOffseted("+90px offset-x", gTextAlignMiddleCenter, 90, 0);
tft.printAlignedOffseted("-30px offset-y", gTextAlignMiddleCenter, 0, -30);
tft.printAlignedOffseted("+30px offset-y", gTextAlignMiddleCenter, 0, 30);

void printAlignedOffseted(const String &str, gTextAlign align, uint16_t offsetX, uint16_t offsetY, gTextEraseLine eraseLine);
void printAlignedOffseted(const __FlashStringHelper *str, gTextAlign align, uint16_t offsetX, uint16_t offsetY, gTextEraseLine eraseLine);
- str - string to print
- align - alignment of string in respect to text area. Can be one of these values:
- gTextAlignTopLeft - aligning to top left
- gTextAlignTopCenter - aligning to top center
- gTextAlignTopRight - aligning to top right
- gTextAlignMiddleLeft - aligning to midlle left
- gTextAlignMiddleCenter - aligning to midlle center
- gTextAlignMiddleRight - aligning to midlle right
- gTextAlignBottomLeft - aligning to bottom left
- gTextAlignBottomCenter - aligning to bottom center
- gTextAlignBottomRight - aligning to bottom right
- offsetX - string offset in x-axis
- offsetY - string offset in y-axis
- eraseLine - can be one of these enum values:
- gTextEraseFromBOL - erases from the beginning of line
- gTextEraseToEOL - erases to the end of line
- gTextEraseFullLine - erases the whole line
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAlignedOffseted("-30px offset-y, EraseFromBOL", gTextAlignMiddleCenter, 0, -30, gTextEraseFromBOL);
tft.printAlignedOffseted("Middle, EraseFullLine", gTextAlignMiddleCenter, 0, 0, gTextEraseFullLine);
tft.printAlignedOffseted("+30px offset-y, EraseToEOL", gTextAlignMiddleCenter, 0, 30, gTextEraseToEOL);

void printAlignedOffseted(const String &str, gTextAlign align, uint16_t offsetX, uint16_t offsetY, uint16_t pixelsClearedOnLeft, uint16_t pixelsClearedOnRight);
void printAlignedOffseted(const __FlashStringHelper *str, gTextAlign align, uint16_t offsetX, uint16_t offsetY, uint16_t pixelsClearedOnLeft, uint16_t pixelsClearedOnRight);
- str - string to print
- align - alignment of string in respect to text area. Can be one of these values:
- gTextAlignTopLeft - aligning to top left
- gTextAlignTopCenter - aligning to top center
- gTextAlignTopRight - aligning to top right
- gTextAlignMiddleLeft - aligning to midlle left
- gTextAlignMiddleCenter - aligning to midlle center
- gTextAlignMiddleRight - aligning to midlle right
- gTextAlignBottomLeft - aligning to bottom left
- gTextAlignBottomCenter - aligning to bottom center
- gTextAlignBottomRight - aligning to bottom right
- offsetX - string offset in x-axis
- offsetY - string offset in y-axis
- pixelsClearedOnLeft - width in pixels to be cleared on the string left side
- pixelsClearedOnRight - width in pixels to be cleared on the string right side
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAlignedOffseted("<- 10px, -30px offset-y , 10px ->", gTextAlignMiddleCenter, 0, -30, 10, 10);
tft.printAlignedOffseted("<- 2px, Middle, 20px ->", gTextAlignMiddleCenter, 0, 0, 2, 20);
tft.printAlignedOffseted("<- 30px, +30px offset-y, 5px ->", gTextAlignMiddleCenter, 0, 30, 30, 5);

void printAlignedPivotedOffseted(const String &str, gTextAlign align, gTextPivot pivot, uint16_t offsetX, uint16_t offsetY);
void printAlignedPivotedOffseted(const __FlashStringHelper *str, gTextAlign align, gTextPivot pivot, uint16_t offsetX, uint16_t offsetY);
- str - string to print
- align - alignment of string in respect to text area. Can be one of these values:
- gTextAlignTopLeft - aligning to top left
- gTextAlignTopCenter - aligning to top center
- gTextAlignTopRight - aligning to top right
- gTextAlignMiddleLeft - aligning to midlle left
- gTextAlignMiddleCenter - aligning to midlle center
- gTextAlignMiddleRight - aligning to midlle right
- gTextAlignBottomLeft - aligning to bottom left
- gTextAlignBottomCenter - aligning to bottom center
- gTextAlignBottomRight - aligning to bottom right
- pivot - string's pivot location. Can be one of these enum values:
- gTextPivotTopLeft - the pivot is in the top left corner of the string
- gTextPivotTopCenter - the pivot is in the top center of the string
- gTextPivotTopRight - the pivot is in the top right corner of the string
- gTextPivotMiddleLeft - the pivot is in the middle left of the string
- gTextPivotMiddleCenter - the pivot is in the middle center of the string
- gTextPivotMiddleRight - the pivot is in the top middle right of the string
- gTextPivotBottomLeft - the pivot is in the bottom left corner of the string
- gTextPivotBottomCenter - the pivot is in the bottom center of the string
- gTextPivotBottomRight - the pivot is in the bottom right corner of the string
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAlignedPivotedOffseted("Text middle line aligned to bottom", gTextAlignBottomRight, gTextPivotMiddleRight, -5, 0);

void printAlignedPivotedOffseted(const String &str, gTextAlign align, gTextPivot pivot, uint16_t offsetX, uint16_t offsetY, gTextEraseLine eraseLine);
void printAlignedPivotedOffseted(const __FlashStringHelper *str, gTextAlign align, gTextPivot pivot, uint16_t offsetX, uint16_t offsetY, gTextEraseLine eraseLine);
- str - string to print
- align - alignment of string in respect to text area. Can be one of these values:
- gTextAlignTopLeft - aligning to top left
- gTextAlignTopCenter - aligning to top center
- gTextAlignTopRight - aligning to top right
- gTextAlignMiddleLeft - aligning to midlle left
- gTextAlignMiddleCenter - aligning to midlle center
- gTextAlignMiddleRight - aligning to midlle right
- gTextAlignBottomLeft - aligning to bottom left
- gTextAlignBottomCenter - aligning to bottom center
- gTextAlignBottomRight - aligning to bottom right
- pivot - string's pivot location. Can be one of these enum values:
- gTextPivotTopLeft - the pivot is in the top left corner of the string
- gTextPivotTopCenter - the pivot is in the top center of the string
- gTextPivotTopRight - the pivot is in the top right corner of the string
- gTextPivotMiddleLeft - the pivot is in the middle left of the string
- gTextPivotMiddleCenter - the pivot is in the middle center of the string
- gTextPivotMiddleRight - the pivot is in the top middle right of the string
- gTextPivotBottomLeft - the pivot is in the bottom left corner of the string
- gTextPivotBottomCenter - the pivot is in the bottom center of the string
- gTextPivotBottomRight - the pivot is in the bottom right corner of the string
- gTextEraseFromBOL - erases from the beginning of line
- gTextEraseToEOL - erases to the end of line
- gTextEraseFullLine - erases the whole line
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAlignedPivotedOffseted("Text middle line aligned to bottom", gTextAlignBottomRight, gTextPivotMiddleRight, -5, 0, gTextEraseFromBOL);

void printAlignedPivotedOffseted(const String &str, gTextAlign align, gTextPivot pivot, uint16_t offsetX, uint16_t offsetY, uint16_t pixelsClearedOnLeft, uint16_t pixelsClearedOnRight);
void printAlignedPivotedOffseted(const __FlashStringHelper *str, gTextAlign align, gTextPivot pivot, uint16_t offsetX, uint16_t offsetY, uint16_t pixelsClearedOnLeft, uint16_t pixelsClearedOnRight);
- str - string to print
- align - alignment of string in respect to text area. Can be one of these values:
- gTextAlignTopLeft - aligning to top left
- gTextAlignTopCenter - aligning to top center
- gTextAlignTopRight - aligning to top right
- gTextAlignMiddleLeft - aligning to midlle left
- gTextAlignMiddleCenter - aligning to midlle center
- gTextAlignMiddleRight - aligning to midlle right
- gTextAlignBottomLeft - aligning to bottom left
- gTextAlignBottomCenter - aligning to bottom center
- gTextAlignBottomRight - aligning to bottom right
- pivot - string's pivot location. Can be one of these enum values:
- gTextPivotTopLeft - the pivot is in the top left corner of the string
- gTextPivotTopCenter - the pivot is in the top center of the string
- gTextPivotTopRight - the pivot is in the top right corner of the string
- gTextPivotMiddleLeft - the pivot is in the middle left of the string
- gTextPivotMiddleCenter - the pivot is in the middle center of the string
- gTextPivotMiddleRight - the pivot is in the top middle right of the string
- gTextPivotBottomLeft - the pivot is in the bottom left corner of the string
- gTextPivotBottomCenter - the pivot is in the bottom center of the string
- gTextPivotBottomRight - the pivot is in the bottom right corner of the string
...
tft.setFont(Arial_bold_14);
tft.setTextArea(10, 10, 300, 200);
tft.clearTextArea(ILI9341_LIGHTBLUE);
tft.setTextColor(ILI9341_WHITE, ILI9341_NAVY);
tft.printAlignedPivotedOffseted("Text middle line aligned to bottom", gTextAlignBottomRight, gTextPivotMiddleRight, -5, 0, 10, 5);

0000000090606060001F000000011B606060002B0000000
11060606000350000000107606060003D00000000FF6060
60004500000000F86060600016000000001F60606000160
...
0000000F26060600013000000002B606060001300000000
EC6060600011000000001B7C7E7C000E000000000C60606
06060002B000000011B606060001F00000001D1000050F0
==== PIXEL DATA END ====
Alternatively you can connect to Arduino from ILIScreenshotViewer and any time screenshotToConsole is called, ILIScreenshotViewer will automatically display the image so there is no need to copy/paste the text strings. Image can be saved in bmp, jpg or png format.
If you are getting errors after you paste in the string or the image has artifacts then try to lower the SPI clock speed before calling screenshotToConsole.
void setup() {
Serial.begin(115200);
tft.begin();
tft.setRotation(iliRotation270); // landscape
tft.fillScreen(ILI9341_BLACK);
tft.drawImage(alert, 140, 100, alertWidth, alertHeight);
// reduce the SPI clock speed if you get errors or image artifacts
//tft.setSPIClockDivider(10); // for Due
//tft.setSPIClockDivider(SPI_CLOCK_DIV8); // for Uno, Mega,...
tft.screenshotToConsole();
}

Serial output:
Display Power Mode: 0x9C
Booster: On and working OK
Idle Mode: Off
Partial Mode: Off
Sleep Mode: Off
Display Normal Mode: On
Display: On
MADCTL Mode: 0x48
Top to Bottom
Right to Left
Reverse Mode
LCD Refresh Top to Bottom
BGR
LCD Refresh Left to Right
Pixel Format: 0x5
16 bits/pixel
Image Format: 0x0
Gamma curve 1
Display Signal Mode: 0x0
Tearing effect line: Off
Tearing effect line: mode 1
Horizontal sync: Off
Vertical sync: Off
Pixel clock: Off
Data enable: Off
Self Diagnostic: 0xC0
Register Loading: working
Functionality: working
Contact
If you want to ask me a question or just contact me, feel free to do so in the Arduino Forum.
------------------------------------------
This is a library for the Adafruit ILI9341 display products
This library works with the Adafruit 2.8" Touch Shield V2 (SPI)
----> http://www.adafruit.com/products/1651
Check out the links above for our tutorials and wiring diagrams.
These displays use SPI to communicate, 4 or 5 pins are required
to interface (RST is optional).
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution