395
TIDE and Tibbo BASIC User Manual
©2000-2008 Tibbo Technology Inc.
Dim
color_red, color_green, color_blue
As
word
...
lcd_red=val("&b"+strgen(lcd.redbits/&hFF,"1")+strgen(lcd.redbits
And
&hFF,"0"))
lcd_green=val("&b"+strgen(lcd.greenbits/&hFF,"1")+strgen(lcd.greenbits
And
&hFF,"0"))
lcd_blue=val("&b"+strgen(lcd.bluebits/&hFF,"1")+strgen(lcd.bluebits
And
&hFF,"0"))
Now you can scientifically work out the constant for the white color:
...
lcd_white=lclcd_blue
In reality, you don't have to bother calculating color_white like this.
Just select the highest possible value (&hFFFF) and this will be your
white.
Preparing the Display for Operation
Several steps need to be taken before the display will become operational. Some of
these steps are display-specific.
section provides
examples of startup code for each supported display.
Generally speaking, you need to take the following steps:
Define which I/O lines and ports of your device control the display. This is done
through the
property.
Configure some I/O lines/ports as outputs, as required for controlling your
particular display. This is only necessary on platforms with explicit output buffer
control. See "Platform-dependent Programming Information" of your platform
documentation to determine if this step is required.
Set the resolution of the display (
,
). These values
depend on the panel, not the controller, so they cannot be detected
automatically. Your application needs to set them "manually".
= 1- YES if you wish the display image to be rotated 180
degrees (that is, the display of your device is installed up side down).
= 1- YES if you need to invert the image on the display (may
be required for certain panels).
= 1- YES. This step will only work if
your display is properly connected, correct display type is selected in your
project, lcd.iomapping is set property, and necessary I/O lines are configured as
outputs. The
R/O property will indicate 1- YES if there was a problem
enabling the display.
Enable, the backlight, if needed -- this is not related to the controller/panel itself,
but is still a necessary step. Light it up, don't linger in the dark!
Working With Pixels and Colors
method allows you to set the color of a single pixel. The method
accepts a 16-bit color word, and the interpretation of this word is controller/panel-
specific (see
Understanding Controller Properties
). In the following example, we
determine the proper value for the green color and put a single green dot in the
408
422
432
421
428
422
416
417
429
393