Getting Started with TFT Display

About This Tutorial
This tutorial discuss evive’s TFT Display, the TFT library in Arduino IDE, and how to display text on the TFT screen.
Tutorial Info

Components Required

ImageComponentQuantityAvailable in Kit
evive1
USB A-B Cable1

Introduction

evive has a TFT display for visual feedback. Visual feedback is very useful for electronics projects and prototyping. It helps you with

  • debugging your code
  • displaying data
  • asking for user feedback
  • giving an aesthetic appearance to your project

evive has a 1.8″ TFT Display with 128 x 160 color pixel. This TFT uses ST7735R TFT driver to display 18-bit color (262,144 shades). 

The TFT is already integrated in the evive library.

evive Notes Icon
If you haven’t installed evive library, visit “here” to see step-wise guide to install it.

 

How to write text on TFT

Follow the steps below to write ‘Hello World’ on the TFT screen:

  • Connect evive to your laptop/PC, and select the appropriate port.
  • Add evive library in your Arduino IDE; it has a lot of functions for TFT display. To initialise the TFT, you must add the function tft_init(INITR_BLACKTAB); in the beginning of the program. This function initialises the TFT screen with a black background.
  • To write on TFT, you must first set the cursor at the point where you want to write. For this, write the statement tft.setCursor (x,y); , where x and y are the coordinates on the screen. The top left corner on the TFT Screen is (1, 1). When you move to right on the screen, x increases, and when you move down, y value increases.
  • To display the text use either tft.print(“Hello World!”); or tft.println(“Hello World”); .
evive Notes Icon

tft.print(): When this function is used to write text, the cursor remains in the same line. If you use this function the second time to write something new, it displays it immediately next to the previously written text. E,g, if you write tft.print(“Hi”); two times, the output on the screen will be HiHi.

tft.println(): This function adds a new line after the text is displayed on the screen. If you use this function to write something new, it will display the net in the new line. E.g. if you write tft.println(“Hi”); twice, the output on the screen will be
Hi
Hi

FunctionDescription
setCursor(int16_t x, int16_t y)Set cursor to a location
print(string)Display input string on TFT
println(string)Display input string on TFT and move to next line
tft_init();initialize TFT display
Pass "INITR_BLACKTAB" in agrument while using this function i.e like tft_init(INITR_BLACKTAB) in order to initialize tft with background.
tft.fillScreen(ST7735_BLACK);this fills display with black colour
tft.setTextColor();this function sets color of text to color passed as argument in this function. For example tft.setTextColor(ST7735_WHITE) sets text color to white.

Example: Hello World!

evive TFT Display: Hello World

Share this Tutorial
Share on facebook
Facebook
Share on twitter
Twitter
Share on google
Google+
Share on pinterest
Pinterest
Share on reddit
Reddit
Share on print
Print
Related Projects & Tutorials
evive TFT Display
How to Manipulate evive’s TFT Display
This tutorial discuss evive's TFT Display, the blocks under evive TFT Display extension, and certain example programs to show the usage of different blocks in Scratch mode.
How to interface water pump with evive?
This tutorial discusses how we can interface water pump with evive . How we can control the speed of water flow using the evive menu? How we can control the speed using potentiometer with a simple scratch code.All the answers are given in this tutorial.LET'S BEGIN....
All articles loaded
No more articles to load
Featured Projects
All articles loaded
No more articles to load

Leave a Reply

Close Menu
×

Cart