This tutorial discusses a few more functions regarding the colour and size of text on evive’s TFT Display using functions from the TFT library in Arduino IDE, apart from the functions discussed in the tutorial on Getting Started with TFT Display.

TFT Colour

You can change the colour of the text using the following function:


where color can be any of these predefined colors:

  1. ST7735_BLACK
  2. ST7735_BLUE
  3. ST7735_RED
  4. ST7735_GREEN
  5. ST7735_CYAN
  6. ST7735_MAGENTA
  7. ST7735_YELLOW
  8. ST7735_WHITE

Apart from this function, other functions can also have these colours in their argument.

Below is an example showing how to change the color of the text on the screen:


Instead of setting colours manually, it is possible to put the responsibility of selecting any random colour on the shoulders of Arduino IDE. It can be done with the help of the function given below:

tft.Color565(uint8_t r, uint8_t g, uint8_t b);

where r, g, b are the red, green and blue value ranging from 0 to 255.

TFT Text Size

You can vary the size of the text using the function shown below:

tft.setTextSize(unit8_t size);

Below is the Arduino sketch showing the use of function for changing the size of the text:



This Helped
This didn't help
Close Menu


STEMpedia Starter Package is now on Indiegogo!
Get 41% OFF with Super Early Bird discounts!