Series: Using the GT-SP Touch Panel TFT Display with Arduino
Design Techniques for Saving GT-SP Page Resources

Table of Contents
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.
|
1 2 3 |
content_image_01.png content_image_02.png content_image_03.png |

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.
|
1 2 3 |
25_SAVING_PAGE_RESOURCES_prj_files └─ 25_SAVING_PAGE_RESOURCES_lib └─ 25_SAVING_PAGE_RESOURCES_IMG.h |

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.
|
1 2 3 |
GUI_DEF_IMG_content_image_01_AD GUI_DEF_IMG_content_image_02_AD GUI_DEF_IMG_content_image_03_AD |

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.
|
1 2 3 4 5 |
unsigned long content_img[3] = { GUI_DEF_IMG_content_image_01_AD, GUI_DEF_IMG_content_image_02_AD, GUI_DEF_IMG_content_image_03_AD }; |
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.
|
1 |
gtsp_ObjPrpSet_val(9, 0x48, 4, content_img[gtsp_res_data_val]); |
This switches the displayed image according to the button selected on PAGE_0, as shown below.
|
1 2 3 |
0 → content_image_01.png 1 → content_image_02.png 2 → content_image_03.png |
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)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
#include <string.h> #include "25_SAVING_PAGE_RESOURCES_IMG.h" // ピン接続 | Pin assign #define GT_DTR 4 // DTR信号 | DTR signal #define GT_DSR 6 // DSR信号 | DSR signal void setup() { pinMode(GT_DTR, INPUT); pinMode(GT_DSR, OUTPUT); digitalWrite(GT_DSR, LOW); Serial.begin(38400); Serial.setTimeout(100); delay(1000); } // 変数 | Variable unsigned long gtsp_res_data_val; // 画像アドレスを格納する配列 | Array storing image addresses unsigned long content_img[3] = { GUI_DEF_IMG_content_image_01_AD, GUI_DEF_IMG_content_image_02_AD, GUI_DEF_IMG_content_image_03_AD }; void loop() { if (Serial.available()) { // 数値データを受信(0, 1, 2, 99) | Receive numeric data (0, 1, 2, 99) gtsp_res_data_val = gtsp_signal_read_numeric(); // デバッグ用:受信した値をシリアルモニタに表示 | Debug: Display the received value on the Serial Monitor Serial.print("Received Val: "); Serial.println(gtsp_res_data_val); // 受信した数値によって、PAGE_1の各オブジェクトを更新 | Update each object on PAGE_1 according to the received value if (gtsp_res_data_val == 0 || gtsp_res_data_val == 1 || gtsp_res_data_val == 2) { // 1. まず画像(No.9)の表示コンテンツを書き換え | 1. First, update the display content of the image (No.9) // LIBファイルの画像アドレスをImage0に設定 | Set the image address from the LIB file to Image0 gtsp_ObjPrpSet_val(9, 0x48, 4, content_img[gtsp_res_data_val]); // 2. テキスト(No.7とNo.8)の内容を書き換え | 2. Update the text content (No.7 and No.8) if (gtsp_res_data_val == 0) { gtsp_ObjPrpSet_string(7, 0x40, "LCD Touch Screen Modules"); gtsp_ObjPrpSet_string(8, 0x40, "Noritake's Touch TFT Modules are high-performance LCD touch display solutions designed for industrial, energy, medical, well-being, and food applications."); } else if (gtsp_res_data_val == 1) { gtsp_ObjPrpSet_string(7, 0x40, "VFD Display Modules"); gtsp_ObjPrpSet_string(8, 0x40, "Noritake's VFD (Vacuum Fluorescent Display) use self-emitting display technology that provides a clear, distinct, and highly visible image."); } else if (gtsp_res_data_val == 2) { gtsp_ObjPrpSet_string(7, 0x40, "OLED Display Modules"); gtsp_ObjPrpSet_string(8, 0x40, "High-performance intelligent design includes all the necessary circuitry to drive the OLED panel with a single 3.3V power source."); } // 3. ページ1へ切り替え(0x10: PAGE Select) | 3. Switch to PAGE_1 (0x10: PAGE Select) gtsp_PgControl(0x10, 1); } } } /********************** GT-SP関数 | Function for GT-SP **********************/ //////////////////////////////////////////////////// // データ受信(数値用) | Receive data from GT-SP (for Numeric) //////////////////////////////////////////////////// unsigned long gtsp_signal_read_numeric() { byte res_dl[4] = ""; unsigned long dl; if (Serial.find("RESb", 4)) { Serial.readBytes(res_dl, 4); //データ長抽出 | Read data length dl = (unsigned long)(res_dl[0] + (res_dl[1] << 8) + (res_dl[2] << 16) + (res_dl[3] << 24)); //データ長変換 | Data length // 数値を受信するためのバッファ | Buffer for receiving numeric data byte res_data_buffer[4]; // データを読み取り | Read data Serial.readBytes(res_data_buffer, dl); // 数値に変換してリターン | Convert to a numeric value and return return (unsigned long)(res_data_buffer[0] + (res_data_buffer[1] << 8) + (res_data_buffer[2] << 16) + (res_data_buffer[3] << 24)); } // エラー時は0を返す(適切なエラー処理が必要な場合は修正が必要) | Return 0 on error (modify if appropriate error handling is required) return 0; } //////////////////////////////////////////////////// // オブジェクト制御コマンド - プロパティ設定 (数値用) | Object Control Command - Property Setting (for Value) //////////////////////////////////////////////////// void gtsp_ObjPrpSet_val(int obj, int prp, int ln, unsigned long val) { gt_print("CMD"); // コマンドヘッダ | Command header gt_put(0xd3); // オブジェクト-プロパティ設定コマンド | Object-Property Setting gt_put(obj >> 0); // オブジェクトNo. 下位バイト | Object No. Lower byte gt_put(obj >> 8); // オブジェクトNo. 上位バイト | Object No. Upper byte gt_put(prp >> 0); // プロパティNo. 下位バイト | Property No. Lower byte gt_put(prp >> 8); // プロパティNo. 上位バイト | Property No. Upper byte gt_put(ln >> 0); // データ長 最下位バイト | Data length Least significant byte gt_put(ln >> 8); // データ長 下位バイト | Data length second byte gt_put(ln >> 16); // データ長 上位バイト | Data length third byte gt_put(ln >> 24); // データ長 最上位バイト | Data length Most significant byte if (ln >= 1) gt_put(val >> 0); if (ln >= 2) gt_put(val >> 8); if (ln >= 3) gt_put(val >> 16); if (ln >= 4) gt_put(val >> 24); } //////////////////////////////////////////////////// // オブジェクト制御コマンド - プロパティ設定 (文字列用) | Object Control Command -Property Setting (for String) //////////////////////////////////////////////////// void gtsp_ObjPrpSet_string(int obj, int prp, String val ) { gt_print("CMD"); //コマンドヘッダ | Command header gt_put(0xd3); //オブジェクト-プロパティ設定コマンド | Object-Property Setting gt_put(obj >> 0); //オブジェクトNo. 下位バイト | Object No. Lower byte gt_put(obj >> 8); //オブジェクトNo. 上位バイト| Object No. Upper byte gt_put(prp >> 0); //プロパティNo. 下位バイト | Property No. Lower byte gt_put(prp >> 8); //プロパティNo. 上位バイト| Object No. Upper byte gt_put(val.length() >> 0); //データ長 最下位バイト | Data length Least significant byte gt_put(val.length() >> 8); //データ長 下位バイト | Data length second byte gt_put(val.length() >> 16); //データ長 上位バイト | Data length third byte gt_put(val.length() >> 24); //データ長 最上位バイト| Data length Most significant byte gt_print(val); //文字列送信 | Send string } //////////////////////////////////////////////////// // GUIページ制御/POPUP制御 | GUI PAGE/POPUP Control Command //////////////////////////////////////////////////// void gtsp_PgControl(int typ, int pg) { gt_print("CMD"); //コマンドヘッダ | Command header gt_put(0xfb); //UIページ制御/POPUP制御設定コマンド | Object-Property Setting gt_put(typ); //制御タイプ | Type (10h:PAGE Select, 20h:POPUP Open, 21h, POPUP Close) gt_put(pg >> 0); //PAGE No. 下位バイト | Page No. Lower byte gt_put(pg >> 8); //PAGE No. 上位バイト| Page No. Upper byte } //////////////////////////////////////////////////// // 1byte送信 | Send byte to GT-SP //////////////////////////////////////////////////// void gt_put(unsigned char onebyte) { while (digitalRead(GT_DTR) == HIGH) {} // ビジーチェック | busycheck Serial.write(onebyte); } //////////////////////////////////////////////////// // 文字列送信 | Send String to GT-SP //////////////////////////////////////////////////// void gt_print(String val) { int val_i; // 文字列を1文字ずつ送信 | Send string per one byte for (val_i = 0; val_i < val.length(); val_i++) { while (digitalRead(GT_DTR) == HIGH) {} // ビジーチェック | busycheck Serial.print(val.substring(val_i, val_i + 1)); } } |
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.
