Series: Using the GT-SP Touch Panel TFT Display with Arduino

Design Techniques for Saving GT-SP Page Resources

Design Techniques for Saving GT-SP Page Resources

DownloadDownload sample project & program (for GT Design Studio & Arduino)

Hello everyone, I’m @kissaten, a beginner in electronics. In this series, I’m explaining the process of connecting a 7-inch touch display (GT-SP series “GTWV070S3A00P”) to an Arduino and working on various projects.

In this article, I will explain techniques for saving page resources, a practical consideration when designing GUIs in GT Design Studio.

In the previous article, we used an image definition file generated by Build in GT Design Studio and specified the images displayed on the GT-SP using definitions corresponding to the image file names.

This time, we will apply the same method to switch the text and images placed on a single template page from Arduino, allowing multiple types of content to be displayed while reducing the number of pages used.

Page Resource Limitations and Practical Challenges

GT-SP series projects can contain up to 50 pages.

This 50-page limit can become a major design challenge when building interfaces with multiple levels of operation screens.
For example, in a food processing machine, a single food item may require multiple related pages, such as a TOP screen, processing settings, progress screens, and a completion screen. With this type of structure, the page limit can be reached after adding only a few food items.

GT Design Studio also provides an object reuse function for efficiently managing objects, but it is still necessary to design the project with the page limit itself in mind. One effective way to avoid running out of page resources is to prepare a single template page and dynamically update only its displayed content from Arduino.

Project Screens Used in This Article

As an example of minimizing page resource usage, we will switch between different content using the following two pages.

  • PAGE_0 (Menu Page): The main menu screen with navigation buttons for selecting each type of content.
  • PAGE_1 (Template Page): A common template page containing text objects, an image object, and a button for returning to the previous page.

Event Settings on the Menu Page

Place buttons on PAGE_0 for selecting each product or process. In the event editing screen for each button, set the action to DATA_TX_FIX.

  • BUTTON_0: Send the value 0
  • BUTTON_1: Send the value 1
  • BUTTON_2: Send the value 2

Arduino receives this value to determine which content has been requested, and then sends the corresponding data to the template page described in the next section.

Object Configuration on the Template Page

To dynamically update the displayed information, place the following objects on PAGE_1.

  • TEXT_1 (No.7): Displays the title
  • TEXT_2 (No.8): Displays the detailed description
  • IMAGE_2 (No.9): Displays the product image

For TEXT_1 and TEXT_2, Arduino sends the text strings corresponding to each product.

For the image displayed in IMAGE_2, register the images in GT Design Studio and use the image definition file generated by Build, as in the previous article.

The following three images are used in this project.

 

Using the Image Definition File Generated by Build

When you run Build in GT Design Studio, various definition files are generated in the project folder.

The image definition file used in this project is generated in the following folder.

25_SAVING_PAGE_RESOURCES_IMG.h contains image addresses defined for the image file names registered in GT Design Studio.

The following definitions are generated for the three images used in this project.

As explained in the previous article, instead of entering the image addresses directly as numeric values, we use the definitions generated from the original image file names in the Arduino program.

On the Arduino side, the addresses of these three images are stored in an array.

 

The value received from PAGE_0 is used as the array index, and the image address to be displayed in Image0 of IMAGE_2 (No.9) is set.

 

This switches the displayed image according to the button selected on PAGE_0, as shown below.

 

For BUTTON_3 (No.10), the return button on PAGE_1, responsiveness is prioritized by configuring the display-side event setting (PAGE_SELECT) to return directly to PAGE_0.

Control Sequence for a Smooth User Experience

The timing of page transitions directly affects the quality of the user interface. If the page is switched before the data is sent, the user can see the display being updated, which may appear as visual noise or flickering. To avoid this, Arduino performs the control sequence in the following order.

  • Background Update: Immediately after Arduino receives the button value, update the image and text on PAGE_1 before switching pages.
  • Page Transition: After all object update commands have been sent, call the gtsp_PgControl function to display PAGE_1.

By following this sequence, the new information is already displayed when the page appears, providing a smooth page transition.

Arduino Control Program

On the Arduino side, first include the image definition file generated by Build.

#include “25_SAVING_PAGE_RESOURCES_IMG.h”

Next, set the image addresses corresponding to the three product images in an array. The values 0, 1, and 2 received from PAGE_0 are used to update the image and the two text objects.

DownloadDownload sample project & program (for GT Design Studio & Arduino)

 

Summary

In this article, we displayed multiple types of content while saving page resources by updating the text and image objects placed on a single template page from Arduino.

According to the value sent from PAGE_0, the two text objects on PAGE_1 are updated, while the image is switched using the image definition file introduced in the previous article.

By specifying images using definitions based on the original image file names, such as GUI_DEF_IMG_content_image_01_AD, it is easier to identify which image is being used in the Arduino program.

In addition, by updating the contents of PAGE_1 before switching pages, a single template page can be shared by multiple types of content while maintaining a smooth page transition.

By dynamically changing the displayed content from Arduino in this way, it is not necessary to create a separate page for each type of content, allowing GT-SP page resources to be used more efficiently.

 

Series: Using the GT-SP Touch Panel TFT Display with Arduino

Series: Using the GT-SP Touch Panel TFT Display with Arduino