How to Draw Shapes on TFT Display

TFT Graphics
About This Tutorial
This tutorial discusses about the functions in the evive TFT screen library in Arduino IDE that help in drawing different shapes on the display with the help of a simple Arduino Sketch.
Tutorial Info

Components Required

ImageComponentQuantityAvailable in Kit
evive1
USB A-B Cable1

Introduction

evive library for TFT Screen in Arduino IDE includes certain functions that allows you to draw lines and different shapes such as:

  • Rectangle
  • Circle
  • Triangle

Functions

Below is the list of the functions present in the library:

FunctionDescription
drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)
Draw a line using two points
drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
Draw a vertical line
drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color)Draw a horizontal line
drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)Draw a rectangle using one point coordinate, width and height
fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)Draw a filled rectangle using one point coordinate, width and height
drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)Draw a circle using center point coordinate and radius of the circle
fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)Draw a filled circle using center point coordinate and radius of the circle
drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)Draw a triangle using three points coordinate

fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)Draw a filled triangle using three points coordinate
drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)Draw a round rectangle using one point coordinate, width, height and radius
fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)Draw a filled round rectangle using one point coordinate, width, height and radius

Example

This example is a simple Arduino IDE sketch which displays the use of each function discussed above. It demonstrates how to draw lines and shapes.

TFT Graphics

 

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
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....
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.
All articles loaded
No more articles to load
Featured Projects
DIY Mini Safe Locker Using Servo
DIY Mini Safe Locker Using Servo

Make your own DIY mini-safe locker using components from the evive Starter Kit and control it using evive’s slide switch!

All articles loaded
No more articles to load

Leave a Reply

Close Menu
×

Cart