AN-00002 ViSi-Genie onChanging and onChanged Events

Description This application note explains the two events raised by an object - onChanging and onChanged.
Supported Processor PICASO, Diablo16
Supported Environment ViSi-Genie
Difficulty Easy

 

 

File Downloads
Files

Description

This Application Note explains the two events raised by an object, onChanging and onChanged.

This application note requires:

  • Workshop 4 has been installed according to the document Workshop 4 Installation;
  • The user is familiar with the Workshop 4 environment and with the fundamentals of ViSi-Genie, as described in Workshop 4 User Guide and ViSi-Genie User Guide;
  • When downloading an application note, a list of recommended application notes is shown. It is assumed that the user has read or has a working knowledge of the topics discussed in these recommended application notes.

 A ViSi-Genie project is provided as examples to help you along this application note.

 

Application Overview

In this application note, the project consists of two objects:

  • A track bar for input.
  • A meter for output.

The track bar sends the value to the meter.

  

Setup Procedure

This application note comes with a zip file which contains two ViSi-Genie projects.

 

For instructions on how to launch Workshop 4, how to open a ViSi-Genie project, and how to change the target display, kindly refer to the section “Setup Procedure” of the application note:

 ViSi Genie Getting Started – First Project for Picaso Displays (for Picaso)
or
ViSi Genie Getting Started – First Project for Diablo16 Displays (for Diablo16).

Simulation Procedure

Let’s consider the track bar. Touching the track bar contains three different moments:

  1. Touch is pressed down,
  2. Touch is maintained down and moved,
  3. Touch is released.

 

  

onChanging

The onChanging event is set to Meter0Set.

The Trackbar0 object sends message continuously as long as the touch is maintained and every time the touch position changes.

This corresponds to the 2nd moment. Many values are sent from 80 down to 20. The meter is updated continuously.

 
onChanged

The onChanged event is set to Meter0Set.

The Trackbar0 object sends a message only when touch is released, so only at the 3rd moment.

Only one value is sent, 20. The meter is only changed once, when the touch is released.

 

Combining Both

Both events can be combined.

Let’s add a third object, a LED Digits, called LedDigits0 with 3 digits and no decimal.

  

Let’s define for the track bar two events:

  • OnChanged: update the LedDigits0,
  • OnChanging, update the Meter0.

 

The meter is going to be updated continuously…

…while the LED digits are going changed only when the touch is released, with 20.

   

 

Build and Upload the Project

For instructions on how to build and upload a ViSi-Genie project to the target display, please refer to the section “Build and Upload the Project” of the application note

 

ViSi Genie Getting Started – First Project for Picaso Displays (for Picaso)
or
ViSi Genie Getting Started – First Project for Diablo16 Displays (for Diablo16).

 
The uLCD-32PTU and/or the uLCD-35DT display modules are commonly used as examples, but the procedure is the same for other displays.

Debugger Output

Setting the handler to Message sends the values to the debugger, Genie Test Executor or GTX.

Launch the Debugger

To launch the Genie Test Executor or GTX, select the Tools menu…

…and then click on the GTX button.

 

 A new screen appears, with the form and objects we have defined previously:

 

onChanging

onChanging sends all the values:

 

 

onChanged

While onChanged sends only the last value:

 

 

 

 

Share: