Skip to content

ViSi-Genie Magic: Custom Slider with a Host

Introduction

To understand this codebase example more quickly, the reader is advised to read and understand first the codebase example 4D-CD-00019 ViSi-Genie Magic Custom Slider.

4D-CD-00019 ViSi-Genie Magic Custom Slider presents a custom slider implementation using the Magic Move and Magic Code objects.

This codebase example, on the other hand, is an improved version of the project in 4D-CD-00019 ViSi-Genie Magic Custom Slider, where in the program sends a REPORT_EVENT message to the serial port every time that a touch release action is detected on the custom slider object. A REPORT_EVENT message is also sent to the serial port every time that touch goes out of the area covered by the custom slider.

To implement the above, the function "SendReport(...)" was used. SendReport(...) is a callable function defined in the ViSi-Genie Communications Protocol. This function sends a REPORT_EVENT or REPORT_OBJ message to the serial port.

In addition to the Magic Code object, the Magic Move object, and the SendReport(...) function, the Magic Release object was also needed to fully implement this project.

The GTX tool was then used to print the messages received from the display module during runtime.

Note

Worskhop 4 PRO is needed for this codebase example.

Video Demo 1


Video Demo 1

Prerequisites

This codebase example assumes the reader can program the 4D Systems display module using Workshop4 IDE ViSi-Genie environment. Beginners are advised to read the following aplication notes.

Instructions

  1. Compile the project and download or upload the program to the target display module (a uLCD-32PTU in this codebase example). Workshop4 also copies the supporting files to a uSD card mounted to the PC. Unmount the uSD card from the PC and mount it to the display module.

  2. The application should now run. If not familiar with the details of this step, see the prerequisites.

  3. Open GTX Tool from Tools > GTX to show the behaviour of the custom slider in response to the touch.

Attachment

Project File