Creating the GUI is probably the trickiest aspect of the
whole deal. After experimenting with some of the
FlexiPanel examples (there are plenty of screen shots in
FlexiPanel.PDF on www.hoptroff.com), you’ll get a good
idea of how the VCP handles the various interface controls.
Once you’re comfortable with what it does, sketch your
interface and work out the details before starting the GUI
script. Let me work backward and show you the final
output before you see the script that develops it.
Take a look at Figure 1. As you can see, all of the
requirements for the controller specified earlier are nicely
handled by the VCP software. The screen shot is actually
from the Windows version of the VCP that is used in
development and testing. Once the program is ready to go,
it can be downloaded (via IrDA link) to the VCP on a
Pocket PC. Figure 2 shows our AC controller interface
running on an HP iPaq.
It All Starts With a Script
Just as cool websites are based on a script (HTML
file), the VCP GUI is created with a simple script. Let’s have
a look at the script that generates the UI for our AC
We start with a header that provides device and
The PARTNUM parameter describes the device that
will hold the GUI information. In our case, we’re using the
pre-built module, which has a part number of irGUI452M.
DEVICENAME identifies the FlexiPanel module for the
VCP (this text will appear in the VCP title bar) and for
other devices that are capable of IrDA communications
(like our PC).
The SERIAL parameter describes how the serial
number is generated for the device. The reason for the
serial number is to prevent conflicts between devices that
are running the same application code. I used RANDOM for
this project. Other options for SERIAL are INCREMENTAL
and manual (user-supplied four-byte serial number). If we
have two devices that serve the same function and we want
to exchange information between them (read from one
and send to the other), we’ll need to match the serial
numbers. The easiest way to do this is to provide the
four-byte serial number manually.
The next line tells the VCP to RESET after it’s configured.
This will make sure that all values are initialized properly.
The onboard controller has extra I/O pins and, for the
Figure 2. VCP on an iPaq.
module, we need to tell them to be set as outputs (
UNASSIGNED_PINS_OUTPUTS) to reduce current consumption.
If using the FlexiPanel irGUI processor in a specialized app,
Circle #123 on the Reader Service Card.