0% encontró este documento útil (0 votos)
145 vistas78 páginas

Funciones del ILI9341 para Display

El documento lista las funciones de la biblioteca ILI9341 para controlar una pantalla TFT. Incluye funciones para dibujar píxeles, líneas, círculos, rectángulos y otras formas; llenar áreas de color; imprimir texto; establecer colores y áreas de texto; y configurar parámetros como la rotación y escala de fuente. Explica brevemente las funciones fillScreen() y drawPixel() como ejemplos.

Cargado por

Javier Camacho
Derechos de autor
© © All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PDF, TXT o lee en línea desde Scribd
0% encontró este documento útil (0 votos)
145 vistas78 páginas

Funciones del ILI9341 para Display

El documento lista las funciones de la biblioteca ILI9341 para controlar una pantalla TFT. Incluye funciones para dibujar píxeles, líneas, círculos, rectángulos y otras formas; llenar áreas de color; imprimir texto; establecer colores y áreas de texto; y configurar parámetros como la rotación y escala de fuente. Explica brevemente las funciones fillScreen() y drawPixel() como ejemplos.

Cargado por

Javier Camacho
Derechos de autor
© © All Rights Reserved
Nos tomamos en serio los derechos de los contenidos. Si sospechas que se trata de tu contenido, reclámalo aquí.
Formatos disponibles
Descarga como PDF, TXT o lee en línea desde Scribd

ILI9341 functions

Functions summary (in alphabetical order)

clearTextArea
void clearTextArea();

clearTextArea
void clearTextArea(gTextArea area);

clearTextArea
void clearTextArea(uint16_t color);

clearTextArea
void clearTextArea(gTextArea area, uint16_t color);

cursorTo
void cursorTo(uint8_t column, uint8_t row);

cursorTo
void cursorTo(uint8_t column);

cursorToXY
void cursorToXY(int16_t x, int16_t y)
display
void display(boolean d);

drawBitmap
void drawBitmap(const uint8_t *bitmap, int16_t x, int16_t y, int16_t w, int16_t

h, uint16_t 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);

drawCircle
void drawCircle(int16_t x, int16_t y, int16_t r, uint16_t color);

drawFastHLine
void drawFastHLine(int16_t x, int16_t y, uint16_t w, uint16_t color);

drawFastVLine
void drawFastVLine(int16_t x, int16_t y, uint16_t h, uint16_t color);

drawImage
void drawImage(const uint16_t *colors, uint16_t x, uint16_t y, uint16_t w,

uint16_t h);

drawLine
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);

drawLineByAngle
void drawLineByAngle(int16_t x, int16_t y, int16_t angle, uint16_t length,

uint16_t color);

void drawLineByAngle(int16_t x, int16_t y, int16_t angle, uint16_t start,

uint16_t length, uint16_t color);

drawPixel
void drawPixel(int16_t x, int16_t y, uint16_t color);

drawRect
void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);

drawRoundRect
void drawRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t radius,

uint16_t color);

drawTriangle
void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2,

int16_t y2, uint16_t color);

fillArc
void fillArc(uint16_t x, uint16_t y, uint16_t radius, uint16_t thickness, float

start, float end, uint16_t color);

fillCircle
void fillCircle(int16_t x, int16_t y, int16_t r, uint16_t color);
fillRect
void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);

fillRoundRect
void fillRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t radius,

uint16_t color);

fillScreen
void fillScreen(uint16_t color);

fillTriangle
void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2,

int16_t y2, uint16_t color);

getCharWidth
uint16_t getCharWidth(uint8_t c);

getCharWidth
uint16_t getCharWidth(uint8_t c, gTextFont font, uint8_t textScale);

getDisplayStatus
void getDisplayStatus();

getFontHeight
uint8_t getFontHeight();
getFontHeight
uint8_t getFontHeight(gTextFont font);

getFontMode
gTextFontMode getFontMode();

getTextArea
gTextArea getTextArea();

getTextBackgroundColor
uint16_t getTextBackgroundColor();

getTextColor
uint16_t getTextColor();

getTextLetterSpacing
uint8_t getTextLetterSpacing();

getTextLineSpacing
uint8_t getTextLineSpacing();

getTextScale
uint8_t getTextScale();
idle
void idle(boolean i);

invertDisplay
void invertDisplay(boolean i);

printAligned
void printAligned(const char *str, gTextAlign align);

void printAligned(const String &str, gTextAlign align);

void printAligned(const __FlashStringHelper *str, gTextAlign align);

printAligned
void printAligned(const char *str, gTextAlign align, gTextEraseLine eraseLine);

void printAligned(const String &str, gTextAlign align, gTextEraseLine eraseLine);

void printAligned(const __FlashStringHelper *str, gTextAlign align,

gTextEraseLine eraseLine);

printAligned
void printAligned(const char *str, gTextAlign align, uint16_t

pixelsClearedOnLeft, uint16_t pixelsClearedOnRight);

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);

printAlignedOffseted
void printAlignedOffseted(const char *str, gTextAlign align, uint16_t offsetX,

uint16_t offsetY);

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);

printAlignedOffseted
void printAlignedOffseted(const char *str, gTextAlign align, uint16_t offsetX,

uint16_t offsetY, gTextEraseLine eraseLine);

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);

printAlignedOffseted
void printAlignedOffseted(const char *str, gTextAlign align, uint16_t offsetX,

uint16_t offsetY, uint16_t pixelsClearedOnLeft, uint16_t pixelsClearedOnRight);

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);

printAlignedPivotedOffseted
void printAlignedPivotedOffseted(const char *str, gTextAlign align, gTextPivot

pivot, uint16_t offsetX, uint16_t offsetY);

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);
printAlignedPivotedOffseted
void printAlignedPivotedOffseted(const char *str, gTextAlign align, gTextPivot

pivot, uint16_t offsetX, uint16_t offsetY, gTextEraseLine eraseLine);

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);

printAlignedPivotedOffseted
void printAlignedPivotedOffseted(const char *str, gTextAlign align, gTextPivot

pivot, uint16_t offsetX, uint16_t offsetY, uint16_t pixelsClearedOnLeft, uint16_t

pixelsClearedOnRight);

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);

printAt
void printAt(const char *str, int16_t x, int16_t y);

void printAt(const String &str, int16_t x, int16_t y);

void printAt(const __FlashStringHelper* str, int16_t x, int16_t y);

printAt
void printAt(const char *str, int16_t x, int16_t y, gTextEraseLine eraseLine);
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);

printAt
void printAt(const char *str, int16_t x, int16_t y, uint16_t pixelsClearedOnLeft,

uint16_t pixelsClearedOnRight);

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);

printAtPivoted
void printAtPivoted(const char *str, int16_t x, int16_t y, gTextPivot pivot);

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);

pushColor
void pushColor(uint16_t color);

pushColors (const PROGMEM array)


void pushColors(const uint16_t *colors, uint16_t offset, uint32_t len);

pushColors
void pushColors(uint16_t *colors, uint16_t offset, uint32_t len);

readPixel
uint16_t readPixel(int16_t x, int16_t y);

screenshotToConsole
void screenshotToConsole();

setAddrWindow
void setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);

setAddrWindowRect
void setAddrWindowRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h);

setAngleOffset
void setAngleOffset(int16_t angleOffset);

setArcParams
void setArcParams(float arcAngleMax);

setFont
void setFont(gTextFont font);

setFontMode
void setFontMode(gTextFontMode fontMode);

setPowerLevel
void setPowerLevel(pwrLevel p);

setRotation
void setRotation(iliRotation r);

setSPIClockDivider
void setSPIClockDivider(uint8_t divider);

setTextArea
void setTextArea(gTextArea area);

setTextArea
void setTextArea(int16_t x, int16_t y, int16_t w, int16_t h);

setTextArea
void setTextArea(int16_t x, int16_t y, int16_t columns, int16_t rows, gTextFont

font);

setTextColor
void setTextColor(uint16_t color);

setTextColor
void setTextColor(uint8_t R, uint8_t G, uint8_t B);
setTextColor
void setTextColor(uint16_t color, uint16_t backgroundColor);

setTextColor
void setTextColor(uint8_t R, uint8_t G, uint8_t B, uint8_t bgR, uint8_t bgG,

uint8_t bgB);

setTextLetterSpacing
void setTextLetterSpacing(uint8_t letterSpacing);

setTextLineSpacing
void setTextLineSpacing(uint8_t lineSpacing);

setTextScale
void setTextScale(uint8_t textScale);

sleep
void sleep(boolean s);

Functions details
fillScreen
Fills/clears the whole screen.
void fillScreen(uint16_t color);

Arguments:
 color - color to fill the screen with
Example:
A screen filled with blue color.
[Link](ILI9341_BLUE);

drawPixel
Draws a pixel.
void drawPixel(int16_t x, int16_t y, uint16_t color);

Arguments:
 x - x-coordinate
 y - y-coordinate
 color - pixel color
Example:
A white pixel at position (100,100).
[Link](100, 100, ILI9341_WHITE);
drawLine
Draws a line.
void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);

Arguments:
 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
Example:
A white line from point (100,100) to point (150,120)
[Link](100, 100, 150, 120, ILI9341_WHITE);

drawLineByAngle
Draws a line defined by a start point and an angle. An offset from the start point can be
defined.
void drawLineByAngle(int16_t x, int16_t y, int16_t angle, uint16_t length,

uint16_t color);

void drawLineByAngle(int16_t x, int16_t y, int16_t angle, uint16_t start,


uint16_t length, uint16_t color);

Arguments:
 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
Example:
A white line from point (100,100) at 45 degree angle and of 50px length. A red line from
point (100,100) at 90 degree angle starting 10px from the start point and with length of
50px.
[Link](100, 100, 45, 50, ILI9341_WHITE);
[Link](100, 100, 90, 10, 50, ILI9341_RED);

drawFastHLine
Draws a horizontal line. Performance optimized version of drawLine for drawing horizontal
lines.
void drawFastHLine(int16_t x, int16_t y, uint16_t w, uint16_t color);

Arguments:
 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
Example:
A white horizontal line from point (100,100) of 50px length.
[Link](100, 100, 50, ILI9341_WHITE);
drawFastVLine
Draws a vertical line. Performance optimized version of drawLine for drawing vertical
lines.
void drawFastVLine(int16_t x, int16_t y, uint16_t h, uint16_t color);

Arguments:
 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
Example:
A white vertical line from point (100,100) of 50px length.
[Link](100, 100, 50, ILI9341_WHITE);

drawRect
Draws a rectangle.
void drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);

Arguments:
 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
Example:
A white rectangle from point (100,100) of 50px width and of 20px height.
[Link](100, 100, 50, 20, ILI9341_WHITE);

fillRect
Draws a filled rectangle.
void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);

Arguments:
 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
Example:
A white filled rectangle from point (100,100) of 50px width and of 20px height.
[Link](100, 100, 50, 20, ILI9341_WHITE);
drawRoundRect
Draws a rectangle with rounded edges.
void drawRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t radius,
uint16_t color);

Arguments:
 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
Example:
A white rounded rectangle from point (100,100) of 50px width, 20px height and rounded
edges of 7px radius.
[Link](100, 100, 50, 20, 7, ILI9341_WHITE);
fillRoundRect
Draws a filled rectangle with rounded edges of specified radius from the specified position
and of specified width and height.
void fillRoundRect(int16_t x, int16_t y, int16_t w, int16_t h, int16_t radius,
uint16_t color);

Arguments:
 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
Example:
A white filled rounded rectangle from point (100,100) of 50px width, 20px height and
rounded edges of 7px radius.
[Link](100, 100, 50, 20, 7, ILI9341_WHITE);
drawCircle
Draws a circle.
void drawCircle(int16_t x, int16_t y, int16_t r, uint16_t color);

Arguments:
 x - x-coordinate of the circle center
 y - y-coordinate of the circle center
 r - circle radius
 color - circle color
Example:
A white circle with center at (100,100) and 20px radius.
[Link](100, 100, 20, ILI9341_WHITE);

fillCircle
Draws a filled circle.
void fillCircle(int16_t x, int16_t y, int16_t r, uint16_t color);

Arguments:
 x - x-coordinate of the circle center
 y - y-coordinate of the circle center
 r - circle radius
 color - circle fill color
Example:
A white filled circle with center at (100,100) and 20px radius.
[Link](100, 100, 20, ILI9341_WHITE);

fillArc
Draws a filled arc. Can also be used to draw a pie.
void fillArc(uint16_t x, uint16_t y, uint16_t radius, uint16_t thickness, float
start, float end, uint16_t color);

Arguments:
 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
Example:
A white arc with center at (100,100), 20px radius, 5px thickness, starting at 45 degrees and
ending at 180 degrees.
A red pie with center at (160,100), 20px radius, starting at 45 degrees and ending at 270
degrees.
[Link](100, 100, 20, 5, 45, 180, ILI9341_WHITE);
[Link](160, 100, 20, 20, 45, 270, ILI9341_RED);

drawTriangle
Draws a triangle.
void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2,
int16_t y2, uint16_t color);

Arguments:
 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
Example:
A triangle defined by points (100,100) (80,130) (120,120).
[Link](100, 100, 80, 130, 120, 120, ILI9341_WHITE);
fillTriangle
Draws a filled triangle.
void fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2,
int16_t y2, uint16_t color);

Arguments:
 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
Example:
A filled triangle defined by points (100,100) (80,130) (120,120).
[Link](100, 100, 80, 130, 120, 120, ILI9341_WHITE);
drawBitmap
Draws a monochrome image from a byte array. A background color can be specified,
otherwise the background will be transparent.
void drawBitmap(const uint8_t *bitmap, int16_t x, int16_t y, int16_t w, int16_t

h, uint16_t 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);

Arguments:
 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.
Example:
Arduino logo with solid and transparent background (arrayMonochromeBitmap example
sketch).
const uint8_t arduLogo[] PROGMEM = {" // width 40, height 32

B00000000, B00000000, B00000000, B00000000, B01111110,"


...

B10001010, B00101111, B00011100, B11100100, B01001110


};

...

[Link](arduLogo, 110, 100, 40, 32, ILI9341_WHITE, ILI9341_DARKCYAN); //

solid background

[Link](arduLogo, 160, 100, 40, 32, ILI9341_DARKCYAN); // transparent


background

drawImage
Draws an image from an array generated with BMP24toILI565Array tool.
void drawImage(const uint16_t *colors, uint16_t x, uint16_t y, uint16_t w,
uint16_t h);

Arguments:
 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)
Example:
3 icons from 3 arrays (arrayTftBitmap example sketch).
#include "info.h
#include "alert.h"
#include "close.h"

...

[Link](info, 100, 100, infoWidth, infoHeight);

[Link](alert, 140, 100, alertWidth, alertHeight);


[Link](close, 180, 100, closeWidth, closeHeight);

invertDisplay
Inverts display colors. Black becomes white, blue becomes yellow, etc.
void invertDisplay(boolean i);

Arguments:
 i - if true colors are inverted, if false - colors are normal
Example:
Invert display colors.
[Link](true);
setAddrWindow
Sets the drawing window for pushPixel and pushPixels operations.
void setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);

Arguments:
 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
Example:
Set the drawing window to a 20x30px region with top left corner at (100, 100).
[Link](100, 100, 119, 129);

setAddrWindowRect
Same as setAddrWindow but uses width and height instead of bottom right corner
coordinates.
void setAddrWindowRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h);

Arguments:
 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
Example:
Set the drawing window to a 20x30px region with top left corner at (100, 100).
[Link](100, 100, 20, 30);

pushColor
Sends one 'pixel' to TFT. setAddrWindow needs to be called prior to calling pushColor to
set the drawing region. If you want to draw just one pixel then it is easier to use
the drawPixelfunction. If you want to draw more pixels within a rectangular area then
combination ofsetAddrWindow and pushColor is a more efficient/faster than
calling drawPixel multiple times. You set your drawing window with setAddrWindow once
and then you call pushPixel multiple times to draw the pixels in left-to-right top-to-bottom
order.
void pushColor(uint16_t color);

Arguments:
 color - pixel color to draw
Example:
Draw a dashed line, 200px long, 3 pixels high. 3 pixels white, 2 pixels blue, 3 pixels white,
2 pixels blue,...
[Link](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)

[Link](ILI9341_WHITE);

[Link](ILI9341_WHITE);

[Link](ILI9341_WHITE);

[Link](ILI9341_BLUE);

[Link](ILI9341_BLUE);

}
}

pushColors (const PROGMEM array)


Sends 'pixels' stored in an array to TFT. Similar to pushColor but instead of passing in one
pixel, you pass in an array of pixels. setAddrWindow needs to be called prior to
calling pushColors to set the drawing region. Using an array/buffer of pixels is even more
efficient than callingpushColor mutiple times.
void pushColors(const uint16_t *colors, uint16_t offset, uint32_t len);

Arguments:
 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
Example:
Draw a dashed line, 200px long, 3 pixels high. 3 pixels white, 2 pixels blue, 3 pixels white,
2 pixels blue,...
const PROGMEM uint16_t pixels[] = { ILI9341_WHITE, ILI9341_WHITE, ILI9341_WHITE,

ILI9341_BLUE, ILI9341_BLUE };

...

[Link](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)

[Link](pixels, 0, 5);

}
}

pushColors
Sends 'pixels' stored in an array to TFT. Similar to pushColors that uses an array stored in
progmem but this function takes in an array stored in RAM so you can modify the content
of the array at runtime and draw from it.
void pushColors(uint16_t *colors, uint16_t offset, uint32_t len);

Arguments:
 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
Example:
Draw a gradient line, 200px long. The gradient is generated at runtime.
uint16_t pixels[200];

...

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);

[Link](60, 100, 200, 3); // set the drawing window to a 200x3px

rectangle

for (byte y = 0; y < 3; y++) { // 3 lines

[Link](pixels, 0, 200); // draw the generated colors


}

readPixel
Reads pixel color from TFT.
uint16_t readPixel(int16_t x, int16_t y);

Arguments:
 x - x-coordinate of the pixel to read the color from
 y - y-coordinate of the pixel to read the color from
Returns - color of the pixel
Example:
Read color of a pixel at position (100,100).
uint16_t color = [Link](100, 100);
setRotation
Sets display orientation.
void setRotation(iliRotation r);

Arguments:
 r - can either be one of these enum values:

o iliRotation0 - portrait mode


o iliRotation90 - landscape mode
o iliRotation180 - portrait mode (rotated by 180 degrees)
o iliRotation270 - landscape mode (rotated by 180 degrees)
or one of these numeric values:

o 0 - portrait mode
o 1 - landscape mode
o 2 - portrait mode (rotated by 180 degrees)
o 3 - landscape mode (rotated by 180 degrees)
Example:
Set rotation to landscape rotated by 180 degrees.
[Link](iliRotation270); // using enum
[Link](3); // using numeric value

display
Turns pixel display on/off. With pixel display off the screen turns white. In the off mode,
the output from Frame Memory is disabled and blank page inserted. This command makes
no change of contents of frame memory.
void display(boolean d);

Arguments:
 d - if true pixel display is on (normal mode), if false - pixel display is off (white screen)
Example:
Turn pixel display off.
[Link](false);

idle
Turns display idle mode on/off. In the idle mode, color depth is reduced. The primary and
the secondary colors using MSB of each R, G and B in the Frame Memory, 8 color depth
data is displayed.
void idle(boolean i);

Arguments:
 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)
Example:
Put LCD into idle mode.
[Link](true);

sleep
Turns display sleep mode on/off. In the sleep mode the LCD module enters the minimum
power consumption mode. The DC/DC converter is stopped, internal oscillator is stopped
and panel scanning is stopped.
void sleep(boolean s);

Arguments:
 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)
Example:
Put LCD into sleep mode.
[Link](true);

setPowerLevel
Sets LCD power level.
void setPowerLevel(pwrLevel p);

Arguments:
 p - can be one of these values:

o pwrLevelNormal - normal mode - restores to normal mode (if it was in idle or sleep or
both)
o pwrLevelIdle - idle mode - same as calling idle(true)
o pwrLevelSleep - sleep mode - same as calling sleep(true)
Example:
Put LCD into sleep mode.
[Link](pwrLevelSleep);

setSPIClockDivider
Sets the SPI clock divider. That changes the clock frequency/speed at which data are
sent/received to/from LCD. The higher the divider the lower the clock frequency and the
drawing speed. If you have issues like LCD not working at all (white screen) or graphical
artifacts then try to increase the divider (or alternatively try to improve your connections
between Arduino and LCD - use the shortest cables possible and prefer soldered
connections over breadboard).
void setSPIClockDivider(uint8_t divider);

Arguments:
 divider
- for Arduino Due - any number between 1 and 255
- for AVR (Uno, Mega,...) one of these values:

o SPI_CLOCK_DIV2 - SPI clock frequency is set to (CPU frequency / 2)


o SPI_CLOCK_DIV4 - SPI clock frequency is set to (CPU frequency / 4)
o SPI_CLOCK_DIV8 - SPI clock frequency is set to (CPU frequency / 8)
o SPI_CLOCK_DIV16 - SPI clock frequency is set to (CPU frequency / 16)
o SPI_CLOCK_DIV32 - SPI clock frequency is set to (CPU frequency / 32)
o SPI_CLOCK_DIV64 - SPI clock frequency is set to (CPU frequency / 64)
o SPI_CLOCK_DIV128 - SPI clock frequency is set to (CPU frequency / 128)
Example:
SPI clock frequency set to approx. 8 MHz.
[Link](10); // for Arduino Due 84MHz/10 = 8.4MHz

[Link](SPI_CLOCK_DIV2); // for Arduino Uno, Mega,... 16MHz/2 =


8MHz

setAngleOffset
Sets the offset in degrees from the default position (set by ARC_ANGLE_OFFSET in
ILI9341_due_config.h) where the arc will start (representing arc angle of 0 degrees). If you
imagine a compass then the default starting position is at the North point (the arc will start
from the top). Setting the offset to 90 degrees will move the starting point 90 degress
clockwise so to the East point (the arc will start from the right side), etc.
void setAngleOffset(int16_t angleOffset);
Arguments:
 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.
Example:
Set the red arc angle start point to West.
Set the yellow arc angle start point to 45 degrees clockwise from North.
Set the green arc angle start point to default.
[Link](-90);

[Link](110, 100, 20, 10, 0, 195, ILI9341_RED);

[Link](45);

[Link](160, 100, 20, 10, 0, 195, ILI9341_YELLOW);

[Link](0);
[Link](210, 100, 20, 10, 0, 195, ILI9341_GREEN);

setArcParams
Sets parameters for drawing arcs. For now it has only one param to set.
void setArcParams(float arcAngleMax);

Arguments:
 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.
Example:
Set the max angle to 100 so we can draw arcs using percentages. Then draw an arc with an
'angle' of 25% which will draw quarter of a circle.
[Link](100); // set arc max value to 100
[Link](160, 120, 50, 10, 0, 25, ILI9341_WHITE); // draw 25% of a circle

setTextArea
Sets the area for drawing the text.
void setTextArea(gTextArea area);

Arguments:
 area - area for drawing the text
Example:
Draw strings into 2 separate areas.
#include "fonts\Arial_bold_14.h"

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

...

[Link](Arial_bold_14);

[Link](ILI9341_WHITE, ILI9341_DARKBLUE);

...

[Link](titleArea);

[Link](ILI9341_LIGHTBLUE); // just to see where the area is

[Link]("My Title");
[Link](descriptionArea);
[Link](ILI9341_LIGHTBLUE);
[Link]("My Description");

setTextArea
Sets the area for drawing the text.
void setTextArea(int16_t x, int16_t y, int16_t w, int16_t h);

Arguments:
 x - x-coordinate of area upper left corner
 y - y-coordinate of area upper left corner
 w - area width
 h - area height
Example:
Draw strings into 2 separate areas.
#include "fonts\Arial_bold_14.h"
...

[Link](Arial_bold_14);

[Link](ILI9341_WHITE, ILI9341_DARKBLUE);

...

[Link](10, 10, 300, 40);

[Link](ILI9341_LIGHTBLUE); // just to see where the area is

[Link]("My Title");

[Link](10, 60, 300, 170);

[Link](ILI9341_LIGHTBLUE);
[Link]("My Description");
setTextArea
Sets the area for drawing the text.
void setTextArea(int16_t x, int16_t y, int16_t columns, int16_t rows, gTextFont
font);

Arguments:
 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
Example:
Draw strings into 2 separate areas.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](ILI9341_WHITE, ILI9341_DARKBLUE);

...

[Link](10, 10, 26, 2, Arial_bold_14); // 26 characters wide and 2

characters high area

[Link](ILI9341_LIGHTBLUE); // just to see where the area is

[Link]("My Title");

[Link](10, 60, 26, 7, Arial_bold_14); // 26 characters wide and 7


characters high area
[Link](ILI9341_LIGHTBLUE); // just to see where the area is
[Link]("My Description");

getTextArea
Gets the current text area.
gTextArea getTextArea();

Example:
Get the current text area.
gTextArea textArea = [Link]('i');

clearTextArea
Clears the currently set text area with the currently set text background color.
void clearTextArea();

Arguments:
Example:
Clear 2 text areas (text background color will be used).
gTextArea titleArea{ 10, 10, 300, 40 };

gTextArea descriptionArea{ 10, 60, 300, 170 };

...

[Link](ILI9341_WHITE, ILI9341_DARKBLUE);

[Link](titleArea);

[Link](); // clear the title area with dark blue color

[Link](ILI9341_WHITE, ILI9341_DARKGRAY);
[Link](descriptionArea);
[Link](); // clear the description area with dark gray color
clearTextArea
Clears the text area with the currently set text background color.
void clearTextArea(gTextArea area);

Arguments:
 area - text area to clear
Example:
Clear 2 text areas (text background color will be used).
gTextArea titleArea{ 10, 10, 300, 40 };

gTextArea descriptionArea{ 10, 60, 300, 170 };

...

[Link](ILI9341_WHITE, ILI9341_DARKBLUE);

[Link](titleArea); // clear the title area with dark blue color

[Link](ILI9341_WHITE, ILI9341_DARKGRAY);

[Link](descriptionArea); // clear the description area with dark gray


color
clearTextArea
Clears the currently set text area.
void clearTextArea(uint16_t color);

Arguments:
 color - color to clear with
Example:
Clear 2 text areas.
gTextArea titleArea{ 10, 10, 300, 40 };

gTextArea descriptionArea{ 10, 60, 300, 170 };

...

[Link](titleArea);

[Link](ILI9341_LIGHTBLUE); // clear the title area with light blue

color

[Link](descriptionArea);

[Link](ILI9341_LIGHTGREEN); // clear the description area with light


green color
clearTextArea
Clears the text area.
void clearTextArea(gTextArea area, uint16_t color);

Arguments:
 area - text area to clear
 color - color to clear with
Example:
Clear 2 text areas.
gTextArea titleArea{ 10, 10, 300, 40 };

gTextArea descriptionArea{ 10, 60, 300, 170 };

...

[Link](titleArea, ILI9341_LIGHTBLUE); // clear the title area with

light blue color

[Link](descriptionArea, ILI9341_LIGHTGREEN); // clear the description


area with light blue color
setFont
Sets the font to use for text rendering. See the Creating Custom Fonts section.
void setFont(gTextFont font);

Arguments:
 font - font to use
Example:
Set Arial bold font for the header and regular one for the description.
#include "fonts\Arial14.h"

#include "fonts\Arial_bold_14.h"

...

gTextArea titleArea{ 10, 10, 300, 40 };

gTextArea descriptionArea{ 10, 60, 300, 170 };

...

[Link](ILI9341_WHITE, ILI9341_DARKBLUE);

[Link](titleArea);

[Link](Arial_bold_14);

[Link]("My Title");

[Link](descriptionArea);

[Link](Arial14);
[Link]("My Description");
getFontHeight
Gets the current font height.
uint8_t getFontHeight();

Example:
Get the current font height.
uint8_t fontHeight = [Link]();

getFontHeight
Gets the font height.
uint8_t getFontHeight(gTextFont font);

Arguments:
 font - font to get the height of
Example:
Get height of the SystemFont5x7 font. Will return number 7.
uint8_t fontHeight = [Link](SystemFont5x7);

getCharWidth
Gets the width of a character in the current font set and with the current text scale.
uint16_t getCharWidth(uint8_t c);

Arguments:
 c - character to get the width of
Example:
Get width of the 'i' character.
uint16_t charWidth = [Link]('i');
getCharWidth
Gets the width of a character.
uint16_t getCharWidth(uint8_t c, gTextFont font, uint8_t textScale);

Arguments:
 c - character to get the width of
 font - font to use for the width calculation
 textScale - text scale to use for the width calculation
Example:
Get width of the 'i' character in SystemFont5x7 font set and with text scale of 2.
uint16_t charWidth = [Link]('i', SystemFont5x7, 2);

setTextColor
Sets the text foreground color.
void setTextColor(uint16_t color);

Arguments:
 color - text color to use
Example:
Set red color for the header and green color for the description. If the background color was
not previously set then black will be used.
#include "fonts\Arial_bold_14.h"

...

gTextArea titleArea{ 10, 10, 300, 40 };

gTextArea descriptionArea{ 10, 60, 300, 170 };

...

[Link](Arial_bold_14);

[Link](titleArea);

[Link](ILI9341_RED);

[Link]("My Title");

[Link](descriptionArea);

[Link](ILI9341_LIME);
[Link]("My Description");
setTextColor
Sets the text foreground color.
void setTextColor(uint8_t R, uint8_t G, uint8_t B);

Arguments:
 R - red
 G - green
 B - blue
Example:
Set red color for the header and green color for the description. If the background color was
not previously set then black will be used.
#include "fonts\Arial_bold_14.h"

...

gTextArea titleArea{ 10, 10, 300, 40 };

gTextArea descriptionArea{ 10, 60, 300, 170 };

...

[Link](Arial_bold_14);

[Link](titleArea);

[Link](255, 0, 0);

[Link]("My Title");

[Link](descriptionArea);

[Link](0, 255, 0);


[Link]("My Description");
setTextColor
Sets the text foreground and background color.
void setTextColor(uint16_t color, uint16_t backgroundColor);

Arguments:
 color - text foreground color
 backgroundColor - text bacground color
Example:
Set red foreground color, dark red background color for the header and green foreground
color, blue background color for the description.
#include "fonts\Arial_bold_14.h"

...

gTextArea titleArea{ 10, 10, 300, 40 };

gTextArea descriptionArea{ 10, 60, 300, 170 };

...

[Link](Arial_bold_14);

[Link](titleArea);

[Link](ILI9341_RED, ILI9341_DARKRED);

[Link]("My Title");

[Link](descriptionArea);

[Link](ILI9341_LIME, ILI9341_BLUE);
[Link]("My Description");
setTextColor
Sets the text foreground color.
void setTextColor(uint8_t R, uint8_t G, uint8_t B, uint8_t bgR, uint8_t bgG,
uint8_t bgB);

Arguments:
 R - foreground red
 G - foreground green
 B - foreground blue
 bgR - background red
 bgG - background green
 bgB - background blue
Example:
Set red foreground color, dark red background color for the header and green foreground
color, blue background color for the description.
#include "fonts\Arial_bold_14.h"

...

gTextArea titleArea{ 10, 10, 300, 40 };

gTextArea descriptionArea{ 10, 60, 300, 170 };

...

[Link](Arial_bold_14);

[Link](titleArea);

[Link](255, 0, 0, 127, 0, 0);


[Link]("My Title");
[Link](descriptionArea);

[Link](0, 255, 0, 0, 0, 255);


[Link]("My Description");

getTextColor
Gets the current text foreground color.
uint16_t getTextColor();

Example:
Get the current text color.
uint16_t textColor = [Link]();

getTextBackgroundColor
Gets the current text background color.
uint16_t getTextBackgroundColor();

Example:
Get the current text background color.
uint16_t textBgColor = [Link]();

setTextLetterSpacing
Sets the spacing between characters. The default is 2px (DEFAULT_LETTER_SPACING).
void setTextLetterSpacing(uint8_t letterSpacing);

Arguments:
 letterSpacing - the distance in pixels between characters
Example:
Set different letter spacings.
#include "fonts\Arial_bold_14.h"

...

gTextArea textArea{ 10, 10, 300, 200 };

...

[Link](Arial_bold_14);

[Link](textArea);

[Link](ILI9341_WHITE, ILI9341_BLUE);

[Link](0);

[Link]("Letter Spacing 0\n");

[Link](1);

[Link]("Letter Spacing 1\n");

[Link](2);

[Link]("Letter Spacing 2\n");

[Link](3);

[Link]("Letter Spacing 3\n");

[Link](4);

[Link]("Letter Spacing 4\n");

[Link](5);

[Link]("Letter Spacing 5\n");

[Link](6);

[Link]("Letter Spacing 6\n");

[Link](7);

[Link]("Letter Spacing 7\n");

[Link](8);

[Link]("Letter Spacing 8\n");

[Link](9);

[Link]("Letter Spacing 9\n");

[Link](10);
[Link]("Letter Spacing 10");
getTextLetterSpacing
Gets the current spacing between characters.
uint8_t getTextLetterSpacing();

Example:
Get the letter spacing.
uint8_t letterSpacing = [Link]();

setTextLineSpacing
Sets the spacing between lines. The default is 0px (DEFAULT_LINE_SPACING).
void setTextLineSpacing(uint8_t lineSpacing);

Arguments:
 lineSpacing - the distance in pixels between lines
Example:
Set different line spacings.
#include "fonts\Arial_bold_14.h"

...

gTextArea textArea{ 10, 10, 300, 200 };

...

[Link](Arial_bold_14);

[Link](textArea);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link](0);
[Link]("Line Spacing 0\n");
[Link](1);

[Link]("Line Spacing 1\n");

[Link](2);

[Link]("Line Spacing 2\n");

[Link](3);

[Link]("Line Spacing 3\n");

[Link](4);

[Link]("Line Spacing 4\n");

[Link](5);

[Link]("Line Spacing 5\n");

[Link](6);

[Link]("Line Spacing 6\n");

[Link](7);

[Link]("Line Spacing 7\n");

[Link](8);

[Link]("Line Spacing 8\n");

[Link](9);

[Link]("Line Spacing 9\n");

[Link](10);

[Link]("Line Spacing 10\n");


[Link]("Line Spacing end");

getTextLineSpacing
Gets the current spacing between lines.
uint8_t getTextLineSpacing();
Example:
Get the line spacing.
uint8_t lineSpacing = [Link]();

setFontMode
Sets solid or transparent font background when rendering text.
void setFontMode(gTextFontMode fontMode);

Arguments:
 fontMode - can be one of these enum values:

o gTextFontModeTransparent - transparent font background


o gTextFontModeSolid - solid font background (default)
Example:
Draw some random colored background and text with transparent and solid backgrounds.
#include "fonts\Arial_bold_14.h"

...

gTextArea textArea{ 10, 10, 300, 200 };

...

for (uint32_t i = 0; i < 320; i += 20){

for (uint32_t j = 0; j < 240; j += 20){

[Link](i, j, 20, 20, random(0,65535));

[Link](Arial_bold_14);

[Link](textArea);

[Link](ILI9341_WHITE, ILI9341_GREEN);

[Link](gTextFontModeTransparent);

[Link]("gTextFontModeTransparent\n\n");

[Link](gTextFontModeSolid);
[Link]("gTextFontModeSolid");
getFontMode
Gets the current font mode. Returns one of the enum values
- gTextFontModeSolid orgTextFontModeTransparent
gTextFontMode getFontMode();

Example:
Get the current font mode.
gTextFontMode fontMode = [Link]();

setTextScale
Sets text scaling.
void setTextScale(uint8_t textScale);

Arguments:
 textScale - text scale multiplier
Example:
Draw text at different scales.
#include "fonts\Arial_bold_14.h"

...

gTextArea textArea{ 10, 10, 300, 200 };

...

[Link](Arial_bold_14);

[Link](textArea);

[Link](ILI9341_WHITE, ILI9341_BLUE);
[Link](1);

[Link]("Text Scale 1\n");

[Link](2);

[Link]("Text Scale 2\n");

[Link](3);

[Link]("Text Scale 3\n");

[Link](4);

[Link]("Text Scale 4\n");

[Link](5);
[Link]("Text Scale 5");

getTextScale
Gets the current font mode. Returns one of the enum values
- gTextFontModeSolid orgTextFontModeTransparent
uint8_t getTextScale();

Example:
Get the current text scale.
uint8_t scale = [Link]();

cursorToXY
Sets the text cursor coordinates. The coordinates are relative to the current text area upper
left corner.
void cursorToXY(int16_t x, int16_t y)

Arguments:
 x - x-coordinate of the string top left corner
 y - y-coordinate of the string top left corner
Example:
Print texts at different locations.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link](10, 10);

[Link]("String 1");

String str2 = "String 2";

[Link](30, 30);

[Link](str2);

[Link](50, 50);
[Link](F("String 3"));

cursorTo
Sets the text cursor column and row at which the text rendering should start. Columns and
rows are numbered from 0 (so the first column is 0, second column is 1, etc.) and are
relative to the current text area. The width of the column matches the width of the widest
character in the font set.
void cursorTo(uint8_t column, uint8_t row);
Arguments:
 column - the column where the text cursor will be set
 row - the row where the text cursor will be set

cursorTo
Sets the text cursor column on the current row. Columns are numbered from 0 (so the first
column is 0, second column is 1, etc.) and are relative to the current text area. The width of
the column matches the width of the widest character in the font set.
void cursorTo(uint8_t column);

Arguments:
 column - the column where the text cursor will be set

printAt
Prints a string. The coordinates are relative to the current text area upper left corner.
void printAt(const char *str, int16_t x, int16_t y);

void printAt(const String &str, int16_t x, int16_t y);


void printAt(const __FlashStringHelper* str, int16_t x, int16_t y);

Arguments:
 str - string to print
 x - x-coordinate of the string top left corner
 y - y-coordinate of the string top left corner
Example:
Print texts at different locations.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link]("String 1", 10, 10);

String str2 = "String 2";

[Link](str2, 30, 30);


[Link](F("String 3"), 50, 50);

printAt
Prints a string and erases areas between the beginning of the line and the string or between
the string and the end of line or both.
void printAt(const char *str, int16_t x, int16_t y, gTextEraseLine eraseLine);

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);

Arguments:
 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:

o gTextEraseFromBOL - erases from the beginning of line


o gTextEraseToEOL - erases to the end of line
o gTextEraseFullLine - erases the whole line
Example:
Print text with different line erase.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);
[Link](10, 10, 300, 200);
[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link]("EraseFromBOL", 100, 10, gTextEraseFromBOL);

String str2 = "EraseToEOL";

[Link](str2, 100, 30, gTextEraseToEOL);

[Link](F("EraseFullLine"), 100, 50, gTextEraseFullLine);

printAt
Prints a string and erases areas on both sides of the string.
void printAt(const char *str, int16_t x, int16_t y, uint16_t pixelsClearedOnLeft,

uint16_t pixelsClearedOnRight);

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);

Arguments:
 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
Example:
Print text with different line erase.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link]("<- 10px on left, 10px on right ->", 30, 10, 10, 10);

String str2 = "<- 2px on left, 20px on right ->";

[Link](str2, 30, 30, 2, 20);

[Link](F("<- 30px on left, 5px on right ->"), 30, 50, 30, 5);

printAtPivoted
Prints a string which is positioned relatively to its pivot.
void printAtPivoted(const char *str, int16_t x, int16_t y, gTextPivot pivot);

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);

Arguments:
 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:

o gTextPivotTopLeft - the pivot is in the top left corner of the string


o gTextPivotTopCenter - the pivot is in the top center of the string
o gTextPivotTopRight - the pivot is in the top right corner of the string
o gTextPivotMiddleLeft - the pivot is in the middle left of the string
o gTextPivotMiddleCenter - the pivot is in the middle center of the string
o gTextPivotMiddleRight - the pivot is in the top middle right of the string
o gTextPivotBottomLeft - the pivot is in the bottom left corner of the string
o gTextPivotBottomCenter - the pivot is in the bottom center of the string
o gTextPivotBottomRight - the pivot is in the bottom right corner of the string
Example:
Print text at the same x-coordinate but with different pivots. You define which pivot to use
and that pivot is then moved (together with the string) to (x,y) location.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link]("PivotTopLeft", 150, 10, gTextPivotTopLeft);

[Link]("PivotTopCenter", 150, 30, gTextPivotTopCenter);


[Link]("PivotTopRight", 150, 50, gTextPivotTopRight);

printAligned
Prints a text area aligned string.
void printAligned(const char *str, gTextAlign align);

void printAligned(const String &str, gTextAlign align);


void printAligned(const __FlashStringHelper *str, gTextAlign align);

Arguments:
 str - string to print
 align - alignment of string in respect to text area. Can be one of these values:

o gTextAlignTopLeft - aligning to top left


o gTextAlignTopCenter - aligning to top center
o gTextAlignTopRight - aligning to top right
o gTextAlignMiddleLeft - aligning to midlle left
o gTextAlignMiddleCenter - aligning to midlle center
o gTextAlignMiddleRight - aligning to midlle right
o gTextAlignBottomLeft - aligning to bottom left
o gTextAlignBottomCenter - aligning to bottom center
o gTextAlignBottomRight - aligning to bottom right
Example:
Print text with different alignments.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link]("TopLeft", gTextAlignTopLeft);

[Link]("TopCenter", gTextAlignTopCenter);

[Link]("TopRight", gTextAlignTopRight);

[Link]("MiddleLeft", gTextAlignMiddleLeft);

[Link]("MiddleCenter", gTextAlignMiddleCenter);

[Link]("MiddleRight", gTextAlignMiddleRight);

[Link]("BottomLeft", gTextAlignBottomLeft);

[Link]("BottomCenter", gTextAlignBottomCenter);
[Link]("BottomRight", gTextAlignBottomRight);
printAligned
Prints a text area aligned string and erases areas between the beginning of the line and the
string or between the string and the end of line or both.
void printAligned(const char *str, gTextAlign align, gTextEraseLine eraseLine);

void printAligned(const String &str, gTextAlign align, gTextEraseLine eraseLine);

void printAligned(const __FlashStringHelper *str, gTextAlign align,


gTextEraseLine eraseLine);

Arguments:
 str - string to print
 align - alignment of string in respect to text area. Can be one of these values:

o gTextAlignTopLeft - aligning to top left


o gTextAlignTopCenter - aligning to top center
o gTextAlignTopRight - aligning to top right
o gTextAlignMiddleLeft - aligning to midlle left
o gTextAlignMiddleCenter - aligning to midlle center
o gTextAlignMiddleRight - aligning to midlle right
o gTextAlignBottomLeft - aligning to bottom left
o gTextAlignBottomCenter - aligning to bottom center
o gTextAlignBottomRight - aligning to bottom right
 eraseLine - can be one of these enum values:

o gTextEraseFromBOL - erases from the beginning of line


o gTextEraseToEOL - erases to the end of line
o gTextEraseFullLine - erases the whole line
Example:
Print text with different alignments.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link]("EraseFromBOL", gTextAlignTopCenter, gTextEraseFromBOL);

[Link]("EraseToEOL", gTextAlignMiddleCenter, gTextEraseToEOL);


[Link]("EraseFullLine", gTextAlignBottomCenter, gTextEraseFullLine);

printAligned
Prints a text area aligned string and erases areas on both sides of the string.
void printAligned(const char *str, gTextAlign align, uint16_t

pixelsClearedOnLeft, uint16_t pixelsClearedOnRight);

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);

Arguments:
 str - string to print
 align - alignment of string in respect to text area. Can be one of these values:
o gTextAlignTopLeft - aligning to top left
o gTextAlignTopCenter - aligning to top center
o gTextAlignTopRight - aligning to top right
o gTextAlignMiddleLeft - aligning to midlle left
o gTextAlignMiddleCenter - aligning to midlle center
o gTextAlignMiddleRight - aligning to midlle right
o gTextAlignBottomLeft - aligning to bottom left
o gTextAlignBottomCenter - aligning to bottom center
o 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
Example:
Print text with different alignments and different erased areas on both sides of the string.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link]("<- 10px on left, 10px on right ->", gTextAlignTopLeft, 10, 10);

[Link]("<- 2px on left, 20px on right ->", gTextAlignMiddleCenter, 2,

20);

[Link]("<- 30px on left, 5px on right ->", gTextAlignBottomRight, 30,


5);
printAlignedOffseted
Prints a text area aligned string with offset.
void printAlignedOffseted(const char *str, gTextAlign align, uint16_t offsetX,

uint16_t offsetY);

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);

Arguments:
 str - string to print
 align - alignment of string in respect to text area. Can be one of these values:

o gTextAlignTopLeft - aligning to top left


o gTextAlignTopCenter - aligning to top center
o gTextAlignTopRight - aligning to top right
o gTextAlignMiddleLeft - aligning to midlle left
o gTextAlignMiddleCenter - aligning to midlle center
o gTextAlignMiddleRight - aligning to midlle right
o gTextAlignBottomLeft - aligning to bottom left
o gTextAlignBottomCenter - aligning to bottom center
o gTextAlignBottomRight - aligning to bottom right
 offsetX - string offset in x-axis
 offsetY - string offset in y-axis
Example:
Print text aligned in the middle with different offsets.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link]("Middle", gTextAlignMiddleCenter, 0, 0); // no actual


offset

[Link]("-90px offset-x", gTextAlignMiddleCenter, -90, 0);


[Link]("+90px offset-x", gTextAlignMiddleCenter, 90, 0);

[Link]("-30px offset-y", gTextAlignMiddleCenter, 0, -30);


[Link]("+30px offset-y", gTextAlignMiddleCenter, 0, 30);

printAlignedOffseted
Prints a text area aligned string with offset and erases areas between the beginning of the
line and the text or between the end of string and the end of line or both.
void printAlignedOffseted(const char *str, gTextAlign align, uint16_t offsetX,

uint16_t offsetY, gTextEraseLine eraseLine);

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);

Arguments:
 str - string to print
 align - alignment of string in respect to text area. Can be one of these values:

o gTextAlignTopLeft - aligning to top left


o gTextAlignTopCenter - aligning to top center
o gTextAlignTopRight - aligning to top right
o gTextAlignMiddleLeft - aligning to midlle left
o gTextAlignMiddleCenter - aligning to midlle center
o gTextAlignMiddleRight - aligning to midlle right
o gTextAlignBottomLeft - aligning to bottom left
o gTextAlignBottomCenter - aligning to bottom center
o 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:

o gTextEraseFromBOL - erases from the beginning of line


o gTextEraseToEOL - erases to the end of line
o gTextEraseFullLine - erases the whole line
Example:
Print text aligned in the middle with different offsets and different line erase.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link]("-30px offset-y, EraseFromBOL", gTextAlignMiddleCenter,

0, -30, gTextEraseFromBOL);

[Link]("Middle, EraseFullLine", gTextAlignMiddleCenter, 0, 0,

gTextEraseFullLine);

[Link]("+30px offset-y, EraseToEOL", gTextAlignMiddleCenter, 0,


30, gTextEraseToEOL);

printAlignedOffseted
Prints a text area aligned string with offset and erases areas on both sides of the string.
void printAlignedOffseted(const char *str, gTextAlign align, uint16_t offsetX,

uint16_t offsetY, uint16_t pixelsClearedOnLeft, uint16_t pixelsClearedOnRight);

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);

Arguments:
 str - string to print
 align - alignment of string in respect to text area. Can be one of these values:

o gTextAlignTopLeft - aligning to top left


o gTextAlignTopCenter - aligning to top center
o gTextAlignTopRight - aligning to top right
o gTextAlignMiddleLeft - aligning to midlle left
o gTextAlignMiddleCenter - aligning to midlle center
o gTextAlignMiddleRight - aligning to midlle right
o gTextAlignBottomLeft - aligning to bottom left
o gTextAlignBottomCenter - aligning to bottom center
o 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
Example:
Print text aligned in the middle with different offsets and different line erase.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);
[Link]("<- 10px, -30px offset-y , 10px ->",

gTextAlignMiddleCenter, 0, -30, 10, 10);

[Link]("<- 2px, Middle, 20px ->", gTextAlignMiddleCenter, 0, 0,

2, 20);

[Link]("<- 30px, +30px offset-y, 5px ->",


gTextAlignMiddleCenter, 0, 30, 30, 5);

printAlignedPivotedOffseted
Prints a pivot based text area aligned string with offset.
void printAlignedPivotedOffseted(const char *str, gTextAlign align, gTextPivot

pivot, uint16_t offsetX, uint16_t offsetY);

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);

Arguments:
 str - string to print
 align - alignment of string in respect to text area. Can be one of these values:

o gTextAlignTopLeft - aligning to top left


o gTextAlignTopCenter - aligning to top center
o gTextAlignTopRight - aligning to top right
o gTextAlignMiddleLeft - aligning to midlle left
o gTextAlignMiddleCenter - aligning to midlle center
o gTextAlignMiddleRight - aligning to midlle right
o gTextAlignBottomLeft - aligning to bottom left
o gTextAlignBottomCenter - aligning to bottom center
o gTextAlignBottomRight - aligning to bottom right
 pivot - string's pivot location. Can be one of these enum values:

o gTextPivotTopLeft - the pivot is in the top left corner of the string


o gTextPivotTopCenter - the pivot is in the top center of the string
o gTextPivotTopRight - the pivot is in the top right corner of the string
o gTextPivotMiddleLeft - the pivot is in the middle left of the string
o gTextPivotMiddleCenter - the pivot is in the middle center of the string
o gTextPivotMiddleRight - the pivot is in the top middle right of the string
o gTextPivotBottomLeft - the pivot is in the bottom left corner of the string
o gTextPivotBottomCenter - the pivot is in the bottom center of the string
o gTextPivotBottomRight - the pivot is in the bottom right corner of the string
 offsetX - string offset in x-axis
 offsetY - string offset in y-axis
Example:
Print text with its middle right pivot aligned to bottom right corner of the text area and
offset it by 5px to the left.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link]("Text middle line aligned to bottom",


gTextAlignBottomRight, gTextPivotMiddleRight, -5, 0);
printAlignedPivotedOffseted
Prints a pivot based text area aligned string with offset and erases areas between the
beginning of the line and the string or between the string and the end of line or both.
void printAlignedPivotedOffseted(const char *str, gTextAlign align, gTextPivot

pivot, uint16_t offsetX, uint16_t offsetY, gTextEraseLine eraseLine);

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);

Arguments:
 str - string to print
 align - alignment of string in respect to text area. Can be one of these values:

o gTextAlignTopLeft - aligning to top left


o gTextAlignTopCenter - aligning to top center
o gTextAlignTopRight - aligning to top right
o gTextAlignMiddleLeft - aligning to midlle left
o gTextAlignMiddleCenter - aligning to midlle center
o gTextAlignMiddleRight - aligning to midlle right
o gTextAlignBottomLeft - aligning to bottom left
o gTextAlignBottomCenter - aligning to bottom center
o gTextAlignBottomRight - aligning to bottom right
 pivot - string's pivot location. Can be one of these enum values:

o gTextPivotTopLeft - the pivot is in the top left corner of the string


o gTextPivotTopCenter - the pivot is in the top center of the string
o gTextPivotTopRight - the pivot is in the top right corner of the string
o gTextPivotMiddleLeft - the pivot is in the middle left of the string
o gTextPivotMiddleCenter - the pivot is in the middle center of the string
o gTextPivotMiddleRight - the pivot is in the top middle right of the string
o gTextPivotBottomLeft - the pivot is in the bottom left corner of the string
o gTextPivotBottomCenter - the pivot is in the bottom center of the string
o gTextPivotBottomRight - the pivot is in the bottom right corner of the string
 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
Example:
Print text with its middle right pivot aligned to bottom right corner of the text area, offset it
by 5px to the left and erase everything from the beginning of the line.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link]("Text middle line aligned to bottom",


gTextAlignBottomRight, gTextPivotMiddleRight, -5, 0, gTextEraseFromBOL);
printAlignedPivotedOffseted
Prints a pivot based text area aligned string with offset and erases areas between the
beginning of the line and the string or between the string and the end of line or both.
void printAlignedPivotedOffseted(const char *str, gTextAlign align, gTextPivot

pivot, uint16_t offsetX, uint16_t offsetY, uint16_t pixelsClearedOnLeft, uint16_t

pixelsClearedOnRight);

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);

Arguments:
 str - string to print
 align - alignment of string in respect to text area. Can be one of these values:

o gTextAlignTopLeft - aligning to top left


o gTextAlignTopCenter - aligning to top center
o gTextAlignTopRight - aligning to top right
o gTextAlignMiddleLeft - aligning to midlle left
o gTextAlignMiddleCenter - aligning to midlle center
o gTextAlignMiddleRight - aligning to midlle right
o gTextAlignBottomLeft - aligning to bottom left
o gTextAlignBottomCenter - aligning to bottom center
o gTextAlignBottomRight - aligning to bottom right
 pivot - string's pivot location. Can be one of these enum values:

o gTextPivotTopLeft - the pivot is in the top left corner of the string


o gTextPivotTopCenter - the pivot is in the top center of the string
o gTextPivotTopRight - the pivot is in the top right corner of the string
o gTextPivotMiddleLeft - the pivot is in the middle left of the string
o gTextPivotMiddleCenter - the pivot is in the middle center of the string
o gTextPivotMiddleRight - the pivot is in the top middle right of the string
o gTextPivotBottomLeft - the pivot is in the bottom left corner of the string
o gTextPivotBottomCenter - the pivot is in the bottom center of the string
o gTextPivotBottomRight - the pivot is in the bottom right corner of the string
 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
Example:
Print text with its middle right pivot aligned to bottom right corner of the text area, offset it
by 5px to the left and erase 10px on the left side of the string and 5px on the right side of
the string.
#include "fonts\Arial_bold_14.h"

...

[Link](Arial_bold_14);

[Link](10, 10, 300, 200);

[Link](ILI9341_LIGHTBLUE);

[Link](ILI9341_WHITE, ILI9341_NAVY);

[Link]("Text middle line aligned to bottom",


gTextAlignBottomRight, gTextPivotMiddleRight, -5, 0, 10, 5);
screenshotToConsole
Takes a screenshot of the whole display and outputs it to the console in the form of a text
string that looks like this:
==== PIXEL DATA START ====

0000000090606060001F000000011B606060002B0000000

11060606000350000000107606060003D00000000FF6060

60004500000000F86060600016000000001F60606000160

...

0000000F26060600013000000002B606060001300000000

EC6060600011000000001B7C7E7C000E000000000C60606

06060002B000000011B606060001F00000001D1000050F0
==== PIXEL DATA END ====

That text string (everything between PIXEL DATA START and PIXEL DATA END, so
starting with 0000... and ending with ...50F0) can be then pasted in the
ILIScreenshotViewer (from the Tools folder) which will convert it back to an image.
Alternatively you can connect to Arduino from ILIScreenshotViewer and any
timescreenshotToConsole 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 screenshotToConsole();

Example:
Draw an icon and take a screenshot. Compile and upload the example. After that run
ILIScreenshotViewer and connect the built-in console to Arduino. COM port is the same as
for uploading sketches and Baud Rate should be set to 115200 (or whatever you set
[Link](xxx)). After Arduino is reset (automatically or manually), a screenshot
should appear in ILIScreenshotViewer. This example is from
examples\iliScreenshotViewer folder.
#include "alert.h"

void setup() {

[Link](115200);

[Link]();

[Link](iliRotation270); // landscape

[Link](ILI9341_BLACK);

[Link](alert, 140, 100, alertWidth, alertHeight);

// reduce the SPI clock speed if you get errors or image artifacts

//[Link](10); // for Due

//[Link](SPI_CLOCK_DIV8); // for Uno, Mega,...

[Link]();
}

getDisplayStatus
Reads the status registers and outputs the settings to Serial.
void getDisplayStatus();

Example:
Get display status.
getDisplayStatus();

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)
----> [Link]
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

También podría gustarte