|Description||This application note explains the two events raised by an object - onChanging and onChanged.|
|Supported Processor||PICASO, Diablo16|
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.
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.
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:
Let’s consider the track bar. Touching the track bar contains three different moments:
- Touch is pressed down,
- Touch is maintained down and moved,
- Touch is released.
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.
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.
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.
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
The uLCD-32PTU and/or the uLCD-35DT display modules are commonly used as examples, but the procedure is the same for other displays.
Setting the handler to Message sends the values to the debugger, Genie Test Executor or GTX.
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 sends all the values:
While onChanged sends only the last value: