Designer and ViSi Environment
The following are the frequently asked questions regarding Workshop4 IDE Designer and ViSi environment.
Is there a function that converts int to float and vice versa?
There are two functions that can be used for 16-bit conversion.
Converting integer(int_value) to float (float_value):
Float_value := flt_FTOI()
Converting float (float_value) to integer (int_value) :
Int_value := flt_ITOF(float_value)
You can check Diablo16 Internal Functions Manual for more information about the float functions.
How to programmatically retrieve the locations of the widgets on the display?
You can use img_GetWord(handle, index, offset)
functions to get the basic widget parameter.
The X-position, Y-position, width, and height can be obtained by following offsets: IMAGE_XPOS, IMAGE_YPOS, IMAGE_WIDTH, IMAGE_HEIGHT.
Example:
Is there a way to adjust the brightness of the display?
The brightness is controlled via software using the contrast command which has a range 0 -15. 0 will turn the backlight off completely while 15 is the maximum brightness.
If you are using Designer or ViSi Environment you can use the command
What can I do with the X mark that I'm getting from the widgets on the display?
When using microSD card widgets, the value will be between 0 to the maximum number of frames. To avoid getting an X mark on the widgets, it will be good to check for the out of range value.
Example: